![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||||
| |||||
|
|
Must a control source always be set for a web browser control source. |
|
2) I set the control source as http://www.google.com. I place a command button on the form. I have the following code for the command button. Me.WebBrowser0.ControlSource = "http://www.youtube.com" |
|
Is there a way to navigate to another page via code? |
|
3) I thought it might be neat to see the current URL value. So I have the following code. |
|
Is there a method one can get the current URL contained in the web browser control? |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
?"Salad" wrote in message news:Lv-dnTG6T6MIc6zQnZ2dnUVZ_sSdnZ2d (AT) earthlink (DOT) com... Must a control source always be set for a web browser control source. No, but when unbound, it much like setting the control source for most controls. So, it does have to be a expression that would be legal to type into a control source. So, to navigate, you could use: Dim s As String s = "=(""www.google.ca"")" Me.WebBrowser93.ControlSource = s Me.WebBrowser93.Visible = True So, the string s in above evaluates to: =("www.google.ca") You can also use a string like: ="www.google.ca" Note that if the control IS bound, then you can just set the value directly. eg: Me.WebBrowser108.value = "www.google.ca" I also in the above had set the default for the control to be not visible if you looking to eliminate the not found web page message. 2) I set the control source as http://www.google.com. I place a command button on the form. I have the following code for the command button. Me.WebBrowser0.ControlSource = "http://www.youtube.com" As noted, if above will work if you use value WHEN it is about, However, if unbound, then: Me.WebBrowser93.ControlSource = "=(""www.youtube.com"")" Is there a way to navigate to another page via code? I not tried this, but there is the move property. (I quite new to this control also). 3) I thought it might be neat to see the current URL value. So I have the following code. Is there a method one can get the current URL contained in the web browser control? Try: MsgBox Me.WebBrowser93.LocationURL So, if you pop open a form in dialog mode, you could have a person perform a web search. And after they seach a few times and find what they want, then you can have the user hit ok, and then the calling code that opened that form as dialog can grab the URL. So they could search for anything, and then you can then stuff that selected URL into the database column, or do whatever. This could be web documents, pictures of parts or cars, or whatever. |
#5
| |||
| |||
|
|
Adding the "=" to the ControlSource string did the trick when assigning to the control source, even moving to it. |
|
Me.WebBrowser0.Object.Navigate or Me.WebBrowser0.Navigate didn't work. I'm not sure what .Navigate is used for. |
![]() |
| Thread Tools | |
| Display Modes | |
| |