Microsoft KB Archive/92899

= ACC: &quot;There Is No Control Called...&quot; Error Message When You Requery a Control =

Article ID: 92899

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 Q92899



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



SUMMARY
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 parameter, 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 (or NWIND.MDB in version 1.x and 2.0). Open the Products form in Design view. Note that the form has a combo box named SupplierID (or Supplier ID in version 1.x and 2.0). Add a command button anywhere to the form. Click the Build button for the command button's OnClick property and click Macro Builder.  Save the macro with the default name suggested by Microsoft Access, and then specify the following Action/Parameter:

     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

Keywords: kberrmsg kbinfo kbusage KB92899

-

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

© Microsoft Corporation. All rights reserved.