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

Go to website on click

Status
Not open for further replies.

kgerlitz

Technical User
Oct 2, 2004
84
0
0
US
I want to be able to click a seperate button that will open my internet browser and go to a website address that I have entered into the "CompanyWebsite" field of my form.

I have to imagine that this is pretty simple code but I have no idea how to write it. Be gentle--I'm really green at this. Thanks for your help
 
Have a look at the Application.FollowHyperlink method.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
This is what I have tried but it does not work--I have tried flipping things around but are clearly taking blind shots.

Private Sub Website_Click()
Dim strInput As String
strInput = Me![CompanyWebsite]
Application.FollowHyperlink strInput, , True
End Sub
 
but it does not work
Any error message ? Unexpected behaviour ? Application crash ? ...
What is the result of MsgBox "'" & Me!CompanyWebsite & "'" ?

Another way is to play with the IsHyperlink property of the TextBox object.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I get a "cannot open the specified file" error message. It points to the "Application.FollowHyperlink strInput, , True
" portion of the code.

I also tried this code instead "Application.FollowHyperlink [CompanyWebsite], , True" but get the same error message. I have tried taking the brackets out with no luck.

When I change the IsHyperlink property to yes it show the field as a hyperlink and actually clicked on the field itself and it worked--but only once, have not been able to do it again.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top