Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
| Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old December 9th, 2005, 05:02 PM
Registered User
 
Join Date: Dec 2005
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Microsoft Web Browser used in MS Access Form

I'm trying to view the yahoo page in a ms access form. I've written the following code to view yahoo when the form is loaded using the Microsoft Web Browser (activeX) control, however, the yahoo page isn't showing. Does anyone now what is causing this problem and how I can fix it?

Public Sub Form_Load()
Me!WebBrowser1.Navigate "http://www.yahoo.com"
End Sub

Thx

  #2 (permalink)  
Old December 9th, 2005, 05:08 PM
Friend of Wrox
 
Join Date: Oct 2004
Location: Clinton, UT, USA.
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Try this...

Public Sub Form_Load()
    Dim strURL as String
    Dim objIE as Object

    strURL = "http://www.yahoo.com"
    Set objIE = Me.WebBrowser1.Object
    objIE.Navigate strURL
End Sub

Mike
EchoVue.com
  #3 (permalink)  
Old December 9th, 2005, 05:12 PM
Registered User
 
Join Date: Dec 2005
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Mike ... I tried your code, but it didn't work for me ... does it work for you?

  #4 (permalink)  
Old December 9th, 2005, 05:18 PM
Registered User
 
Join Date: Dec 2005
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Mike ... your code is identical to my code. It seems that the problem I'm having is that the activex control is being activated when the form is loaded ... does anyone know what is causing this?

  #5 (permalink)  
Old December 9th, 2005, 05:25 PM
Friend of Wrox
 
Join Date: Oct 2004
Location: Clinton, UT, USA.
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Mine works in a couple of other apps I have.

If the code is in the Form_Load module, it will always activate when the form is loaded. If you would like it to activate on a button click or something similar, you would want to move it to the sub for the associated event.

One thing that might be making a difference is whatever name you have assigned to the ActiveX control. I think ocxBrowser might be the default name.



Mike
EchoVue.com
  #6 (permalink)  
Old December 9th, 2005, 06:20 PM
Registered User
 
Join Date: Dec 2005
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Mike... how can I confirm the name of the Web Browser? I did it by inserting the web browswer into Excel and reading the name from the NameBox .. Is there another way?

  #7 (permalink)  
Old December 9th, 2005, 06:59 PM
Friend of Wrox
 
Join Date: Oct 2004
Location: Clinton, UT, USA.
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Just right click the control, choose Properties and look at the Name property.

Mike
EchoVue.com
  #8 (permalink)  
Old December 9th, 2005, 07:12 PM
Registered User
 
Join Date: Dec 2005
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I finally got it to work .. thxs

  #9 (permalink)  
Old December 9th, 2005, 07:17 PM
Friend of Wrox
 
Join Date: Oct 2004
Location: Clinton, UT, USA.
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Anytime!! And welcome to the Forum

Mike
EchoVue.com


Similar Threads
Thread Thread Starter Forum Replies Last Post
MS Access Form Bind With OO4O MTForm Access VBA 4 February 27th, 2008 04:29 PM
MS ACCESS + Microsoft Visual Studio neha2007 Visual Studio 2005 0 June 15th, 2007 09:55 AM
Print web form in browser Roy Ng ASP.NET 1.0 and 1.1 Professional 1 July 15th, 2005 03:42 PM
View MS Access Reports in Browser minic Classic ASP Databases 0 December 14th, 2004 02:38 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.