ACC2000: Compile Error After Converting Form Macros to VBA (209907)
The information in this article applies to:
This article was previously published under Q209907 Moderate: Requires basic macro, coding, and interoperability skills.
SYMPTOMS
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>.
Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. 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 1
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: - Open the form or report in Design view.
- Set the object's HasModule property to No, and then save the object.
NOTE: Any Visual Basic code that the object contains is removed along with its class module when you set the HasModule property to No.
- On the Tools menu, point to Macro, and then click Convert Form's Macros to Visual Basic or Convert Report's Macros to Visual Basic.
A new class module is created for the object and no duplicate procedure
names exist.
Method 2
You can open the object's class module in Design view and remove the duplicate procedure:
- Open the object in Design view.
- On the View menu, click Code.
- On the Debug menu, click Compile <DBname>. You will receive the following error message:
Ambiguous name detected: <Procedure Name>.
- Look through the class module, looking for another procedure with the same name as the one that produced the compile error.
- Select and delete the unwanted procedure.
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.
Modification Type: | Minor | Last Reviewed: | 10/11/2006 |
---|
Keywords: | kbprb kbProgramming KB209907 |
---|
|