Link to home
Start Free TrialLog in
Avatar of Tom Crowfoot
Tom CrowfootFlag for United Kingdom of Great Britain and Northern Ireland

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_Loaded") 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
---------------------------------------------------------------------------------------------------
Avatar of Scott McDaniel (EE MVE )
Scott McDaniel (EE MVE )
Flag of United States of America image

Do you mean your popup would host all the search strings in textboxes? If so, you can refer to them like this:

WebBrowser8.Navigate Forms("YourPopupForm").YourTextboxName
Avatar of Tom Crowfoot

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").NameOfYourTextbox
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").Text465
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").Text465

Do you get errors from either of them? Also, can you post back the values returned by each?
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.WebBrowser8.Navigate Forms("Frm_People").Text465

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&viewCriteria=1&search=&lname=" & [LastName]
Error.png
ASKER CERTIFIED SOLUTION
Avatar of Scott McDaniel (EE MVE )
Scott McDaniel (EE MVE )
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Perfect - thank you very much for your help
Perfect - thank you very much for your help