Microsoft KB Archive/98226

= ACC: Cannot Find Macro Error Message =

Article ID: 98226

Article Last Modified on 1/18/2007

-

APPLIES TO


 * Microsoft Access 1.0 Standard Edition
 * Microsoft Access 1.1 Standard Edition
 * Microsoft Access 2.0 Standard Edition
 * Microsoft Access 95 Standard Edition
 * Microsoft Access 97 Standard Edition

-



This article was previously published under Q98226



Moderate: Requires basic macro, coding, and interoperability skills.



SYMPTOMS
When you are entering data in a form, you may receive the following error message:

Macro '' not found



CAUSE
This behavior can be caused by one or more spaces having been inadvertently typed in the event properties of either a form or a control, such as in the OnCurrent or the AfterUpdate properties.



RESOLUTION
Open the form in Design view and remove the space(s).



STATUS
This behavior is by design.



MORE INFORMATION
Microsoft Access trims the space when displaying the error message, so you see two single quotation marks with no space separating them, which looks like one double quotation mark.

You should be able to determine whether the space is located in a control's event property or a form's event property, based on what actions trigger the message.

For example, if the error occurs in one of the following situations, check the suggested properties.
 * 1) Opening the form:
 * 2) * Check the Form's OnOpen or OnCurrent property.
 * 3) * Also check the OnLoad property of forms in Microsoft Access 2.0, 7.0, and 97.
 * 4) * Check the OnEnter property for the first control that receives the focus when the form is opened.
 * 5) * Also check the OnGotFocus property of controls in Microsoft Access 2.0, 7.0, and 97.
 * 6) Typing in a control:
 * 7) * Check the control's BeforeUpdate or AfterUpdate property.
 * 8) * Also check the control's OnKeyDown, OnKeyPress, OnKeyUp, OnChange properties in version 2.0.
 * 9) Saving a record:
 * 10) * Check the form's BeforeUpdate or AfterUpdate property.
 * 11) Moving to a new record:
 * 12) * Check the form's OnCurrent property (also see #3).

NOTE: This is not a complete list of causes.

After you have determined which property is causing the behavior, open the form in Design view and remove the space from that property. If you are still not sure which property is causing the behavior, go to each property that is blank and press the DELETE key.

NOTE: You may have spaces in multiple properties; therefore, it is a good idea to check them all.

Steps to Reproduce Behavior
This example uses the sample database Northwind.mdb (or NWIND.MDB in Microsoft Access 1.x or 2.0).
 * 1) Open the Employees form in Design view.
 * 2) Display the property sheet by clicking Properties on the View menu.
 * 3) Select the Last Name control and type a single space in the AfterUpdate property.
 * 4) View the form in Form view and type data in the Last Name control. Note that when you attempt to exit this field, you receive the error message mentioned in the &quot;Symptoms&quot; section of this article.

