ACC: Compile Error After Converting Form Macros to VBALast reviewed: August 29, 1997Article ID: Q163842 |
The information in this article applies to:
SYMPTOMSModerate: Requires basic macro, coding, and interoperability skills. After you convert macros to Visual Basic for Applications code in a form or report using the "Convert Macros to Visual Basic" command, you may receive the following error message when you use the form.
In Microsoft Access 97
The expression <Event Name> you entered as the event property setting produced the following error: Ambiguous name detected: <Procedure Name>. In Microsoft Access 7.0
The expression <Event Name> you entered as the event property setting produced an error: Compile error.This article assumes that you are familiar with Visual Basic for Applications and with creating Microsoft Access applications using the programming tools provided with Microsoft Access. For more information about Visual Basic for Applications, please refer to your version of the "Building Applications with Microsoft Access" manual.
CAUSEAt one time, the object had an event procedure that was later changed to a macro.
RESOLUTIONTo prevent the error, open a form or report class module in Design view and delete the procedure for the event whenever you replace an event procedure with a macro. To resolve the error, you must remove the duplicate procedure in the object's class module using one of the following methods.
Method 1In Microsoft Access 97, if the object does not contain a mixture of Visual Basic code and macros, you can remove the object's class module before you convert its macros:
Method 2In Microsoft 7.0 and 97, you can open the object's class module in Design view and remove the duplicate procedure:
MORE INFORMATIONWhen you replace [Event Procedure] with the name of a macro in Design view of a form or report, the procedure itself remains in the object's class module. When you convert the macro to a Visual Basic procedure, the Wizard does not check to see if a procedure for that event already exists, and it creates a duplicate procedure.
Steps to Reproduce BehaviorThe following example uses a form; you can obtain the same results using a report.
REFERENCESFor more information about using the Convert Macros to Visual Basic command, search the Help Index for "converting macros," or ask the Microsoft Access 97 Office Assistant. Keywords : FmsEvnt Version : 7.0 97 Platform : WINDOWS Hardware : x86 Issue type : kbprb Solution Type : Info_Provided |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |