Hi AMoller.
This is complicated due to the lack of information that would be needed to help properly. I would assume that the following means you have a Control on the current Form named Hyperlink and that this control is probably a TextBox :
AMoller:
Have a form with field Hyperlink
That is probably the easy part.
AMoller:
Trying to get a button to launch said hyperlink but keep getting a runtime 8 error.
While error numbers are never a problem, they don't tell us much without having to go and look them up to find the text of the error message. Feel free to post the number as well, but it's always a good idea to include the text. In this case I was unable to determine any message for error #8 so completely in the dark :-(
AMoller:
Here's my code for the click button.
As far as the code goes there's nothing obviously wrong. However, the names raise questions.
- If it's a Command Button (CmdButton) control why is it named Toggle40? I suspect you've dragged a ToggleButton control onto your Form instead of a CmdButton. It's an easy mistake to make if you aren't very familiar with things.
- Access has a Hyperlink object. Be very careful with names of your own items (Forms / Controls / etc). They can lead people to misunderstand what it is you're trying to do. In this case I suspect the Control is actually a TextBox that happens to be called Hyperlink - as opposed to a Hyperlink control itself. I suspect that confused CactusData into giving that particular suggestion.
- An alternative to the code you have, after adjusting for using a (properly named) CmdButton instead of the existing Control, would be :
- Private Sub cmdLink_Click()
-
Call FollowHyperlink(Address:=Me.txtHyperlink.Text)
-
End Sub
Let us know how you get on with this.