We help IT Professionals succeed at work.

Use pop up form to control web browser

270 Views
Last Modified: 2013-11-28
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
---------------------------------------------------------------------------------------------------
Comment
Watch Question

Scott McDaniel (EE MVE )Infotrakker Software
CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2014

Commented:
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

Author

Commented:
the Search Strings would ideally be hosted in the main form (frm_People) rather than the pop up
Scott McDaniel (EE MVE )Infotrakker Software
CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2014

Commented:
Either way ... just refer to the correct form in the Navigate method:

WebBrowser.Navigate Forms("NameOfYourForm").NameOfYourTextbox

Author

Commented:
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?
Scott McDaniel (EE MVE )Infotrakker Software
CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2014

Commented:
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?

Author

Commented:
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
Infotrakker Software
CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2014
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
Perfect - thank you very much for your help

Author

Commented:
Perfect - thank you very much for your help
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.