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

ID: Q209749


The information in this article applies to:
  • Microsoft Access 2000

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:

  1. Open the sample database Northwind.mdb.


  2. Open the Products form in Design view. Note that the form has a combo box named SupplierID.


  3. Add a command button anywhere to the form.


  4. Click the Build (...) button for the command button's OnClick property, and then click Macro Builder in the Choose Builder dialog box.


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


  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:


  8. There is no field called '[SupplierID]' in the current record.
  9. Restore the macro, remove the brackets from [SupplierID] in the Control Name argument, and then save the macro.


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


Additional query words: named prb

Keywords : kberrmsg kbusage kbdta McrArg
Version : WINDOWS:2000
Platform : WINDOWS
Issue type : kbprb


Last Reviewed: May 13, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.