Switchboard Hyperlink Problem

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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:
 
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
 
Back
Top