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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Code for URL Launcher on Access Form

Status
Not open for further replies.

chandraj

Technical User
Mar 12, 2008
8
US
hey all...i'm in the process of finalizing my db and want to put a command button on my form that would open up IE and display a webpage on click. i've been googling for codes, as i'm a VBA rookie so couldn't write the entire code myself. got as far as getting IE opened. but it stops right there. the 2nd step errors. it seems simple but i just couldn't get it to work. please help. thanks. :)
 
Hi

Try Docmd.followhyperlink "yourlinkhere"

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
 
getting IE opened. but it stops right there. the 2nd step errors
Which code and which error ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
thanks for the reply, KenReay. tried your code. errorred with the following: "Method or data member not found" referring to ".FollowHyperLink".
 
PHV, this is code I used:
-----
Dim stFile As String
Dim oApp As Object

'Path to URL
stFile = "
'Create an instance of Internet Explorer
Set oApp = CreateObject(Class:="InternetExplorer.Application")
oApp.Visible = True

'Open the URL
oApp.Open URL:=stFile
-----
IE opens but doesn't display anything. There has to be something wrong with the second part of the code where I ask to display the starbucks homepage (which, by the way, is just a test link). Error is: Run-time error 483: Object doesn't support this property or method
 
KenReay, found the following code online, and it worked:
-----
Dim str As String
str = "«linkhere»"

Application.FollowHyperlink str, , True
----

Thanks. I couldn't have found it without your tip. I used "docmd.followhyperlink" as my keyword in searching.

Question...since the code doesn't specify what browser, does this mean it will open whatever the default browser is? See above in my recent post where I actually specified IE as the browser.

Thanks
 
How about using the embedded browser on your form and using

Code:
Private Sub LoadPage()
Dim IE                  As Object
Dim strSQL              As String

strSQL = "<URL of required webpage>"

Set IE = Me.Browser1.Object

    IE.Navigate strURL

    ' Halts code whilst page loads
    While IE.Busy
        DoEvents
    Wend

   Exit Sub
End Sub

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top