ACC1x: How to Requery a Combo Box on Subform

Last reviewed: May 14, 1997
Article ID: Q101082
The information in this article applies to:
  • Microsoft Access versions 1.0 and 1.1
  • Microsoft Access Distribution Kit version 1.1

SUMMARY

This article describes a macro that will requery a combo box control on a subform. This macro is useful for a combo box that is based on a query that references the main form and thus should be requeried whenever you change records on the main form.

MORE INFORMATION

The following sample macro will requery the combo box:

   Macro Name     Action          Defined Below
   --------------------------------------------
   RequeryCombo   GoToControl     1
                  GotoControl     2
                  Requery         3

   RequeryCombo Actions
   -----------------------------------------
   1. GotoControl
         ControlName: <Subform ControlName>
   2. GotoControl
         ControlName: <ComboBox ControlName>
   3. Requery
         ControlName: <ComboBox ControlName>

When this macro is run, it will requery the combo box. If you want the combo box to be requeried each time you change records in the main form, add this macro to the OnCurrent property of the main form.

REFERENCES

For more information on form events, search for "events" then "events for forms" using the Microsoft Access Help menu.


Additional query words: macros forms
Keywords : FmsEvnt kbusage
Version : 1.0 1.1
Platform : WINDOWS
Hardware : X86
Issue type : kbhowto


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 14, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.