Open an URL with a Command Button

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to allow user to click on a button and bring up an URL but I don't
know what the code is. Thank you in advance.
 
FollowHyperlink should do it, e.g.:
FollowHyperlink "http://www.microsoft.com"

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

"questionnaire database analyst"
 
That was helpful. Thank you so much. However, when I tried to open up a
website with the last part of the link changing, it doesn't work. This is
what I have tried:

a = "www.msn.com." & Me.EmployeeID

FollowHyperlink (a)

I want the last part to be changing so I can open up a php page with the
matching employeeID key :) thanks in advance.
 
That kind of approach should work.

Use Debug.Print to check that the link you are forming works correctly:

Dim strLink As String
strLink = "http://www.msn.com/" & Me.EmployeeID & ".php"
Debug.Print strLink
FollowHyperlink strLink

After running that code, open the Immediate Window (Ctrl+G), and copy the
link that was printed there into the address bar of your browser. Hopefully
that will help in the process of getting the string correct.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

"questionnaire database analyst"
 
Back
Top