Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
0 out of 6 rated this helpful - Rate this topic

DoCmd.Requery Method

Office 2007
Carries out the Requery action in Visual Basic.

Syntax

expression.Requery(ControlName)

expression   A variable that represents a DoCmd object.

Parameters

NameRequired/OptionalData TypeDescription
ControlNameOptionalVariantA string expression that's the name of a control on the active object.

Remarks

You can use the Requery action to update the data in a specified control on the active object by requerying the source of the control. If no control is specified, this action requeries the source of the object itself. Use this action to ensure that the active object or one of its controls displays the most current data.

If you leave the Control Name argument blank, the Requery action has the same effect as pressing SHIFT+F9 when the object has the focus. If a subform control has the focus, this action requeries only the source of the subform (just as pressing SHIFT+F9 does).

If you want to requery a control that isn't on the active object, you must use the Requery method in Visual Basic, not the Requery action or its corresponding Requery method of the DoCmd object. The Requery method in Visual Basic is faster than the Requery action or the DoCmd.Requery method. In addition, when you use the Requery action or the DoCmd.Requery method, Microsoft Access closes the query and reloads it from the database, but when you use the Requery method, Access reruns the query without closing and reloading it. Note that the ActiveX Data Object (ADO) Requery method works the same way as the Access Requery method.

Example

The following example uses the Requery method to update the EmployeeList control:

Visual Basic for Applications
DoCmd.Requery "EmployeeList"


Community Additions

Show:
© 2014 Microsoft. All rights reserved.