Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

ACC2000: Invalid Reference in SetValue Macro Expression


View products that this article applies to.

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).

↑ Back to the top


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

↑ Back to the top


Cause

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

↑ Back to the top


Resolution

Remove the leading equal sign in the Expression argument.

↑ Back to the top


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

↑ Back to the top


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.

↑ Back to the top


Keywords: KB209622, kbusage, kbprb, kberrmsg

↑ Back to the top

Article Info
Article ID : 209622
Revision : 2
Created on : 6/29/2004
Published on : 6/29/2004
Exists online : False
Views : 289