ACC: "There Is No Control Called..." Requery Control Err Msg

Last reviewed: May 7, 1997
Article ID: Q92899
The information in this article applies to:
  • Microsoft Access versions 1.0, 1.1, 2.0, 7.0, 97

SUMMARY

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

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 is confusing.

The following example reproduces the behavior and discusses a workaround:

  1. Open the sample database Northwind.mdb (or NWIND.MDB in version 1.x and 2.0).

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

  3. Add a command button anywhere to the form.

  4. Click the Build button for the command button's OnClick property and click Macro Builder.

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

  6. Save and minimize the macro.

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

  8. Restore the macro, remove the brackets from [SupplierID] in the Control Name argument, and then save the macro.

  9. Switch the form to Form view and click the command button. Note that the control now works properly.


Additional query words: named
Keywords : kberrmsg kbusage McrArg
Version : 1.0 1.1 2.0 7.0 97
Platform : WINDOWS
Hardware : X86
Issue type : kbinfo


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: May 7, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.