I have followed the instructions on Allen Browne's site for GoHyperlink() below.
I then created a form that contains a text box (Text0) bound to a field in a table that contains a hyperlink to a PDF document. Also on the form is a Command Button (Command2) control that has an On Click event procedure that leads to a Private Sub:
Private Sub Command2_Click()
Call GoHyperlink(Me.[Text0])
End Sub
But when I click on the Command Button, I get an error as follows:
"The expression On Click you entered as the event property produced the following error: Object or class does not support the set of events."
I would appreciate advice on what I'm doing wrong. I'm using MS Access 2003.
Using GoHyperlink()
To use GoHyperlink() in your database:
- Create a new stand-alone module in your database. Open the code window (Ctrl+G), and the
New Module button
on the toolbar (2nd from left on Standard toolbar.)
- Paste in the code below.
- To verify Access understands it, choose Compile on the Debug menu.
- Save the module, with a name such as ajbHyperlink.
You can now use GoHyperlink() anywhere in your database.
For example if you have a form with a hyperlink field named MyHyperlink,