Microsoft KB Archive/209749

= ACC2000: "There Is No Control Called..." Requery Control Err Msg =

Article ID: 209749

Article Last Modified on 6/24/2004

-

APPLIES TO


 * Microsoft Access 2000 Standard Edition

-



This article was previously published under Q209749



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



SYMPTOMS
When you try to requery a control by using the Requery macro action, you receive an error message indicating that the specified control does not exist even though the control does exist on the form.



MORE INFORMATION
For the Requery Control Name arument, Microsoft Access expects a short control name without any brackets ([ ]). The Microsoft Access Help system states that you should not use the full syntax, but it does not state that the brackets must be omitted, even if the control name consists of more than one word. Because other scenarios require the use of brackets, this inconsistency may be confusing.

The following example reproduces the behavior and discusses a workaround:  Open the sample database Northwind.mdb. Open the Products form in Design view. Note that the form has a combo box named SupplierID. Add a command button anywhere to the form. Click the Build (...) button for the command button's OnClick property, and then click Macro Builder in the Choose Builder dialog box.  Click OK in the Save As dialog box to save the macro with the default name suggested by Microsoft Access, and then specify the following Action and Action Arguments:      Action       : Requery Control Name : [SupplierID] Note that [SupplierID] is enclosed in brackets.  Save and minimize the macro.</li> Switch the form to Form view and click the command button. Note that you receive the following error:

There is no field called '[SupplierID]' in the current record.

</li> Restore the macro, remove the brackets from [SupplierID] in the Control Name argument, and then save the macro.</li> Switch the form to Form view and click the command button. Note that the control now works properly.</li></ol>

Additional query words: named prb

Keywords: kberrmsg kbprb kbusage KB209749

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.