Article ID: 209907 - Last Review: October 11, 2006 - Revision: 2.2 ACC2000: Compile Error After Converting Form Macros to VBAThis article was previously published under Q209907 Moderate: Requires basic macro, coding, and interoperability skills.
On This PageSYMPTOMS
After you convert macros to Visual Basic for Applications code in a form or
report by using the "Convert Macros to Visual Basic" command, you may
receive the following error message when you use the form or report.
The expression <Event Name> you entered as the event property setting produced the following error: Ambiguous name detected: <Procedure Name>.
CAUSE
At one time, the form or report had an event procedure that was later
changed to a macro.
RESOLUTION
To 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, use one of the following methods to remove the duplicate procedure in the object's class module. Method 1If 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 2You can open the object's class module in Design view and remove the duplicate procedure:
MORE INFORMATION
When 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 by using a report.
REFERENCESFor more information about using the Covert Macros to Visual Basic command, in the Visual Basic Editor, click Microsoft Visual Basic Help on the Help menu, type converting macros in the Office Assistant or the Answer Wizard, and then click Search to view the topic.
| Article Translations
|
Back to the top
