Fix the GoHyperlink Object or Class Error in Access 2003
Question details
The user needs an Access 2003 form button to open a PDF referenced by a hyperlink field.

- Product
- Microsoft Access 2003
- Device & OS
- not provided
- Scenario
- A form button calls GoHyperlink to open a PDF stored in a table field.
- Observed behavior
- The button's On Click event produces an error stating that the object or class does not support the set of events.
Open the database and identify the form button, its On Click event, and the field containing the PDF path. Confirm that the PDF exists and can be opened directly from its stored location.
Test the button event and compile GoHyperlink in a standard module
Use this approach to separate a button event problem from a problem in the hyperlink code.
Open the form in Design View, select the button, and open its Properties sheet. On the Event tab, set On Click to [Event Procedure].
Click the build button next to On Click to open the VBA editor. Temporarily replace the statements inside the button's Click procedure with MsgBox "Hello World", then return to Form View and click the button.
In the VBA editor, choose Insert > Module. Place the existing GoHyperlink code in the new standard module, ensuring that any procedure called from the form is accessible to it.
Choose Debug > Compile in the VBA editor, correct any reported errors, and save the module. Restore the button's GoHyperlink call in its Click procedure and test it again in Form View.

Store the PDF path as text and test FollowHyperlink
Try a plain text path when the Hyperlink data type or newer example code may be contributing to the problem.
Work with Office documents using WPS Office
WPS Office is a free, lightweight alternative for working with common Office documents in a familiar interface. Its format support helps you move everyday document, spreadsheet, and presentation work from Microsoft Office; it does not fix Access form events or replace an Access database.

Frequently Asked Questions
How can I tell whether the button event itself is working?
In the form's Design View, set the button's On Click property to [Event Procedure]. Open the event procedure, temporarily use MsgBox "Hello World" inside it, and click the button in Form View.
Where should I put the GoHyperlink code?
In the VBA editor, choose Insert > Module and place the existing code in the new standard module. Then choose Debug > Compile and save the module before testing the button.
Why try a text field instead of a Hyperlink field?
A Hyperlink field can contain display text and other hyperlink components rather than just a file path. A separate Text field lets you test a plain PDF path with a compatible opening method.
Does WPS Office repair Access 2003 form events?
No. WPS Office can work with common Office documents and PDFs, but it does not repair Microsoft Access form events or replace an Access database.




