Microsoft Access Form References to Undefined Procedures

Provided by the FMS Development Team

References to procedures that were deleted or renamed will fail when the user encounters them. These references are “hidden” within your application and very hard to detect. The database may compile fine, but if a procedure no longer exists, that is a time-bomb ready to explode.

For example, the textbox control txtMessage contains a reference to the procedure ShowValue() in the On Lost Focus event. At the time the application was created, the procedure existed in the application. However, problems occur if the procedure is deleted, renamed, or parameters added or deleted.

Microsoft Access does not give you a compile error. Instead, a run-time error will be generated when the event is triggered. You do not want run-time errors to appear in your application!

Text Box: txtMessage

How do you avoid this type of problem? Avoid writing code directly in your property sheets and use Event Procedures instead. That puts your code directly in a module and visible to the compiler so you can verify the procedure name and parameters are valid every time you compile your code. You can also use Total Access Analyzer which provides detailed code analysis to verify your procedure calls exist and have the right number of parameters.

For more details, see Total Access Analyzer (Errors, Suggestions, and Performance Tips).

Additional Resources



Thank you! Thank you! I just finished reading this document, which was part of a link in the recent Buzz newsletter. I have printed it for others to read, especially those skeptical on the powers of Access and its capabilities.

Darren D.

View all FMS products for Microsoft Access All Our Microsoft Access Products



Free Product Catalog from FMS