Switchboard Hyperlink Problem

G

Guest

Hello,

I have a standard switchboard that I created with the Switchboard Manager.
One of the buttons I have on it is supposed to be a hyperlink to another
database. I tried to create it by choosing the command "Run Code" in the
Switchboard Item box, and typed the function name "OpenReportDb ().

The function "OpenReportDb" is in a module and is as follows:

Function OpenReportDb()
On Error GoTo OpenReportDb

Application.FollowHyperlink "P:\Pharmacy\report_tacl\Reports\reports.mdb"

Exit_OpenReportDb:
Exit Function

Err_OpenReportDb:

MsgBox Error$, 16, Prog$
Resume Exit_OpenReportDb

End Function

But when I then try to use that option button on the switchboard, it tells
me it cannot find the procedure "OpenReportDB ()". Any idea why this isn't
working?

Thank you in advance.

Janet
 
J

Jeff Conrad

Hi Janet,

Two things you need to correct.

1. Re-run the SBM and then in the Function box
for this option just enter

OpenReportDb

That's it, nothing else. No () symbols.

2. The second line of your code says this:
On Error GoTo OpenReportDb

You need to change that to match your actual Error Handler:

On Error GoTo Err_OpenReportDb

That should do it.
--
Jeff Conrad
Access Junkie - MVP
http://home.bendbroadband.com/conradsystems/accessjunkie.html
http://www.access.qbuilt.com/html/articles.html

in message:
 
J

Jeff Conrad

G

Guest

Jeff,

I change the name of the function to Public Function, then deleted the
button on my switchboard and recreated it. Now it works! Thanks very much
for your help.

Janet
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top