Tom Crowfoot
asked on
Use pop up form to control web browser
Dear Experts
I am using Access 2003 & have a web browser [WebBrowser8] built into a form [Frm_People] I have created a number of predefined searches built into text boxes in the main form. These predefined searches are text boxes with a control source to run, for example a Google search using the persons name and the firm they work for.
These text boxes reside in the main form and are set as not visible.
Prior to adding on more predefined searches these were run from commands in the main form, which worked fine as a simple WebBrowser8.Navigate ([textbox]). But I now want to create a pop up form ("Pop_Frm_Rsch_Zone_People _Pre_Loade d") to house all the commands as its neater, but I cannot get the pop up form to control the navigation on the main form:
This is what I am trying, can anyone help?
-------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---
Private Sub GooglefullCMD_Click()
With Form_Frm_People
WebBrowser8.Navigate ([Txt_Google_Full])
End With
End Sub
-------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---
I am using Access 2003 & have a web browser [WebBrowser8] built into a form [Frm_People] I have created a number of predefined searches built into text boxes in the main form. These predefined searches are text boxes with a control source to run, for example a Google search using the persons name and the firm they work for.
These text boxes reside in the main form and are set as not visible.
Prior to adding on more predefined searches these were run from commands in the main form, which worked fine as a simple WebBrowser8.Navigate ([textbox]). But I now want to create a pop up form ("Pop_Frm_Rsch_Zone_People
This is what I am trying, can anyone help?
--------------------------
Private Sub GooglefullCMD_Click()
With Form_Frm_People
WebBrowser8.Navigate ([Txt_Google_Full])
End With
End Sub
--------------------------
ASKER
the Search Strings would ideally be hosted in the main form (frm_People) rather than the pop up
Either way ... just refer to the correct form in the Navigate method:
WebBrowser.Navigate Forms("NameOfYourForm").Na meOfYourTe xtbox
WebBrowser.Navigate Forms("NameOfYourForm").Na
ASKER
HI LSM Consulting,
Really not sure where I am going wrong here, I have the text boxes residing in the main form "Frm_People" and have tried lots of variations around your comment the latest is this
Private Sub Command467_Click()
WebBrowser8.Navigate Forms("Frm_People").Text46 5
End Sub
I keep getting a run tiem error 424 - object required - can you help?
Really not sure where I am going wrong here, I have the text boxes residing in the main form "Frm_People" and have tried lots of variations around your comment the latest is this
Private Sub Command467_Click()
WebBrowser8.Navigate Forms("Frm_People").Text46
End Sub
I keep getting a run tiem error 424 - object required - can you help?
Place a breakpoint on that line of code (i.e. highlight that line of code and press F9). Now run the code by clicking the Command467 button. When the code breaks into the VBA editor, type this in the Immediate window:
?Me.WebBrowser8.Name
and
?Forms("frm_People").Text4 65
Do you get errors from either of them? Also, can you post back the values returned by each?
?Me.WebBrowser8.Name
and
?Forms("frm_People").Text4
Do you get errors from either of them? Also, can you post back the values returned by each?
ASKER
I think I might know where the isssue is but no idea how to resolve it .... would I be right in thinking that as WebBrowser8 resides in the form "frm_People" & not the pop up we are running the command from I haven't named the WebBrowser properly i.e. should be something like ... Forms_frm_people.WebBrowse r8.Navigat e Forms("Frm_People").Text46 5
I haev done the tests above ... When I put in the "?Me.WebBrowser8.Name" in the break it defaults to "Print Me.WebBrowser8.Name" would that be correct - if it is then it does return an error message (attached)
Also the controll source for Text465 is ="http://www.linkedin.com/search?sortCriteria=Relevance&proposalType=Y&pplSearchOrigin=ADVS&newnessType=Y&fname=" & [FirstName] & "&searchLocationType=Y&vie wCriteria= 1&search=& lname=" & [LastName]
Error.png
I haev done the tests above ... When I put in the "?Me.WebBrowser8.Name" in the break it defaults to "Print Me.WebBrowser8.Name" would that be correct - if it is then it does return an error message (attached)
Also the controll source for Text465 is ="http://www.linkedin.com/search?sortCriteria=Relevance&proposalType=Y&pplSearchOrigin=ADVS&newnessType=Y&fname=" & [FirstName] & "&searchLocationType=Y&vie
Error.png
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Perfect - thank you very much for your help
ASKER
Perfect - thank you very much for your help
WebBrowser8.Navigate Forms("YourPopupForm").You