Article ID: 148529
Article Last Modified on 1/19/2007
APPLIES TO
- Microsoft Access 95 Standard Edition
- Microsoft Access 97 Standard Edition
This article was previously published under Q148529
Moderate: Requires basic macro, coding, and interoperability skills.
SYMPTOMS
If you convert a database from Microsoft Access 2.0 to Microsoft Access 7.0
or Microsoft Access 97, and that converted database has a user-defined
procedure and a module with the same name, you may receive the following
error message when the procedure is run from an object's events.
In Microsoft Access 97:
The expression [event name] you entered as the event property setting
produced the following error: The expression you entered has a function
name that Microsoft Access can't find.
In Microsoft Access 7.0:
The expression [event name] you entered as the event property setting
produced an error. There was an error compiling this function.
If you use the RunCode action in a macro to call the function, then you may
receive the following error message:
In Microsoft Access 97:
The expression you entered has a function name that Microsoft Access
can't find.
In Microsoft Access 7.0:
There was an error compiling this function. The Visual Basic module
has a syntax error. Solution: Check the code and then recompile it.
If you try to run the procedure from the Debug window, then you may receive
the following error message:
Expected variable or procedure, not module.
These errors occur even if the procedure is not contained in the module
with the same name.
NOTE: All the modules in the converted database will appear to compile
successfully.
NOTE: This behavior is exposed only when the function is initially run
because Microsoft Access 7.0 and 97 do not load a module until a function
or subroutine within the module is called.
CAUSE
This behavior is likely to occur after you convert a database from
Microsoft Access version 2.0. Microsoft Access 7.0 and 97 do not allow a
user-defined function and module to have the same name.
RESOLUTION
Change the name of the module so that it is different from the name of any
procedure that you have in the database.
Additional query words: conversion name can t
Keywords: kberrmsg kbprb kbprogramming KB148529