ACC2000: Syntax Error When You Convert a Macro to Visual Basic for Applications Code (253259)
The information in this article applies to:
This article was previously published under Q253259 Moderate: Requires basic macro, coding, and interoperability skills.
This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).
SYMPTOMS
When you convert a macro to Visual Basic for Applications (VBA) and the macro contains a form reference that requires brackets, you may receive a syntax error when you run or compile the converted code.
CAUSE
The expression that contains the form reference has been split on two separate lines, for example:
Forms![Customer Orders]!CompanyName
= "This is a test"
RESOLUTION
To avoid this problem, rename the form so that it does not require brackets before you convert the macro. Realize, however, that if you rename the object, you may also have to change the references to the object in the macro and other objects.
To correct this problem after the macro has been converted, edit the converted code so that the expression is on one line.
STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.
Modification Type: | Major | Last Reviewed: | 6/30/2004 |
---|
Keywords: | kbbug KB253259 |
---|
|