Link to website.

ebev

New member
Local time
Yesterday, 22:01
Joined
Oct 16, 2008
Messages
2
I am using Access 2007 and using this code to link a command button to a website.


Private Sub QRC_Click()

strUrl = "https://some.website.com/*********/some?process=QRC"

Call Shell("explorer.exe " & strUrl, vbMaximizedFocus)

End Sub

It works on every website except one. I think it has something to do with the "=" in the URL because when i click on the button it says "QRC cannot be found." I would like to know if there is another way to link to this website with a command button.

Note: I can't use the real URL because my they did not want me to.
 
Copy and Paste the URL directly into the Address Bar of your Browser. If the Web Page does not display then there is a problem with he URL itself.

If it does display when directly applied to the in the browser but not in code then there is something wrong with the URL string. for example, perhaps there are quotation marks within the URL that you re not handling properly within your strUrl variable.

.
 
You might try using

FollowHyperlink strURL

instead.
 
I am using Access 2007
FollowHyperlink strURL

Im guessing the FollowHyperlink command is a relatively new feature because Im using Access 2000 and mine returned the message 'Run-time error 490, Cannot find the specified file.'.

Code:
Private Sub lblwebsite_Click()

Dim strURL As String
strURL = txtCustWebsite.Value
FollowHyperlink strURL

End Sub

-------------- EDIT : Solution found --------------

After playing with another example, this works for me (although I would have preferred not using the entire file path).

Code:
Private Sub lblwebsite_Click()

Dim strURL As String

strURL = txtCustWebsite.Value
Call Shell("c:\program files\internet explorer\iexplore.exe " & strURL, vbNormalFocus)

End Sub
 
Last edited:
Im guessing the FollowHyperlink command is a relatively new feature because Im using Access 2000 and mine returned the message 'Run-time error 490, Cannot find the specified file.'.
No, it works in 2000 so it would have to do with what your strURL is returning.
 

Users who are viewing this thread

Back
Top Bottom