PRB: ACC97: Run Method Can't Find Procedure Although It Exists (190943)
The information in this article applies to:
- Microsoft Visual Basic for Applications 5.0
- Microsoft Access 97
This article was previously published under Q190943 SYMPTOMS
You attempt to use the Run method in Microsoft Access 97 (or from
automation) to run a custom procedure in a database. Although the correct
database is open and the procedure exists, you get the following error
using the Run method:
Run-time error '2517':
Microsoft Access can't find the procedure <procedure name>.
CAUSE
This problem occurs if the name of the procedure matches the name of a
module in the database. Also, each form and report object in the database
may be given a hidden module automatically. These module names are
Form_<form name> if the module is for a form, or Report_<report name> if
the module is for a report. Therefore, if the name of the procedure you are
unable to run begins with Form_ or Report_, the problem may be caused by a
conflict with a form or report module. For example, if you have a procedure
named Report_Report1 and you also have a report named Report1, you can
experience this problem.
RESOLUTION
Change the name of the procedure so that it does not match the name of a
module in the database. In order to determine the module names in the
database (so that you can determine what names not to use) follow these
steps:
- Using Microsoft Access 97, open the database that contains the
procedure you are unable to run.
- Click Options from the Tools menu.
- Check "System Objects" on the View tab.
- Click OK to close the Options dialog.
You should now see a table in the database named "MsysModules2." Open the table and view the Name field. The Name field lists all modules in the database. Make sure that you do not name a procedure with the same name as a module. Note: Do not edit the MsysModules2 table.
Be sure to deselect "System Objects" on the View tab when finished viewing the MsysModules2 table.
STATUS
This behavior is by design.
Modification Type: | Minor | Last Reviewed: | 10/11/2006 |
---|
Keywords: | kbAutomation kbprb kbProgramming KB190943 |
---|
|