Control Object, Form Object.
The Requery method updates the data underlying a specified form, or a control that is on the active form, by requerying the source of data for the form or control.
object.Requery
The Requery method uses the following argument.
Argument |
Description |
object |
A Form or Control object representing the form or control you want to update. Omit this argument to requery the source of data for the active object. |
Use this method to ensure that a form or control displays the most recent data.
The Requery method does one of the following:
Controls based on a query or table include:
If you specify any other type of control for object, the record source for the form is requeried.
If the control specified by object isn’t bound to a field in a table or query, the Requery method forces a recalculation of the control.
If you omit object, the Requery method requeries the underlying source of data for the form or control that has the focus. If the control that has the focus has a record source or row source, it will be requeried; otherwise the control’s data will simply be refreshed.
If a subform control has the focus, this method only requeries the record source for the subform, not the parent form.
Note Notes
Control Object, Form Object, Recalc Method, Refresh Method, Repaint Method.
This example uses the Requery method to requery the data from the EmployeeList list box on an Employees form.
Sub RequeryList() Dim ctlList As Control ' Return Control object pointing to list box. Set ctlList = Forms!Employees!EmployeeList ' Requery source of data for list box. ctlList.RequerySub