- To create a macro, open the form in Design view.
-
Display the property sheet for the form or control on the form and then click the Event tab.
-
Click the event property for the event that you want to trigger the macro.
For example, to respond to a mouse click on a command button, open the button's OnClick event procedure.
-
Click Build next to the property box to display the Choose Builder dialog box.
-
Double-click Macro Builder to display the macro window.
-
Click Save to save the macro.
- In a blank action row, click Requery in the action list.
To update records for a control that is based on a table or query, set the Control Name argument to the name of the control.
To update the records for the form as a whole, leave the Control Name argument blank.
- To test, run the macro by opening the form in Form view and performing the event that triggers the requery.
- To open the event procedure for the appropriate event, open a form in Design view.
-
Display the property sheet for the form or control on the form and then click the Event tab.
-
Click the event property for the event that you want to trigger the procedure.
For example, to respond to a mouse click on a command button, open the button's OnClick event procedure.
-
Click Build next to the property box to display the Choose Builder dialog box.
-
Double-click Code Builder to display the event procedure window.
- Add the Requery method to the procedure for the form or control whose records you want to update. For example, to view the latest records in a combo box called CategoryID, add the following method to the procedure:
CategoryID.Requery
- To test, run the procedure by opening the form in Form view and performing the event that triggers the requery.