ACC2000: Invalid Reference in SetValue Macro Expression (209622)



The information in this article applies to:

  • Microsoft Access 2000

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 'value.'

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.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Create the following macro and save it as My Macro:
       Macro Name    Action       Action Arguments
       --------------------------------------------
       My Macro      SetValue     Item: Field0
                                  Expression: ="A023bbb"
    					
  2. Create a new form not based on any table or query.
  3. Add a command button to the form by dragging My Macro from the Database window to the Detail section of the form.
  4. Add a text box to the form and set its Name property to Field0.
  5. Open the form in Form view.
  6. 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.'

REFERENCES

For more information about the SetValue action, click Microsoft Access Help on the Help menu, type setvalue action in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

Modification Type:MajorLast Reviewed:6/29/2004
Keywords:kberrmsg kbprb kbusage KB209622