Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Web Browser on Access Form 1

Status
Not open for further replies.

hc98br

ISP
Aug 14, 2003
46
Hi, I'm trying to embed a web browser into a form in access, the basic priciples have worked, I've added a "Microsoft Web Browser" active x control, called it ie and used the following code to load a page:

Code:
ie.Naviagate "[URL unfurl="true"]http://www.msn.com"[/URL]

All good, but I want to know when the page has loaded. I've checked the readystate property, starts at 1, when the page is loaded is 4 - great - but if it loop until 4, Access just locks up, doesn't even load the page!

Heres my code:
Code:
ie.Naviagate "[URL unfurl="true"]http://www.msn.com"[/URL]
While ie.ReadyState <> 4: Wend
MsgBox "Loaded!"

BTW, I'm using Access 2007 in Vista.


Any help would be most appreciated - thanks,


Ben.



 
You may try this:
While ie.ReadyState <> 4
DoEvents
Wend

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Many thanks - that forced me to look harder at that, I had come dangerously close to it - but hadn't quite understood (not really done very much vba stuff!!)

As a result I found the drop downs at the top of the vb editor, which showed me all the available event - in actual fact, I found DocumentComplete worked better!


Cheers


Ben.



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top