Microsoft KB Archive/209622

= ACC2000: Invalid Reference in SetValue Macro Expression =

Article ID: 209622

Article Last Modified on 6/29/2004

-

APPLIES TO


 * Microsoft Access 2000 Standard Edition

-



This article was previously published under Q209622



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
If the Expression argument of a SetValue macro action evaluates to a text expression that begins with a letter, you may receive the following error message when a SetValue macro action tries to set the value of a control:

The object doesn't contain the Automation object ' .'



CAUSE
The Expression argument of a SetValue macro action that begins with a leading equal sign (=) is understood to be a field name.



RESOLUTION
Remove the leading equal sign in the Expression argument.



Steps to Reproduce Behavior
  Create the following macro and save it as My Macro:   Macro Name    Action       Action Arguments My Macro     SetValue     Item: Field0 Expression: ="A023bbb"  Create a new form not based on any table or query. Add a command button to the form by dragging My Macro from the Database window to the Detail section of the form. Add a text box to the form and set its Name property to Field0 . Open the form in Form view.</li> Click the command button to run the macro.

Note that you receive the following error message:

The object doesn't contain the Automation object 'A023bbb.'

</li></ol>

<div class="references_section">