DoCmd.RepaintObject method (Access)

The RepaintObject method carries out the RepaintObject action in Visual Basic.

Syntax

expression.RepaintObject (ObjectType, ObjectName)

expression A variable that represents a DoCmd object.

Parameters

Name Required/Optional Data type Description
ObjectType Optional AcObjectType An AcObjectType constant that specifies the type of object to repaint.
ObjectName Optional Variant A string expression that's the valid name of an object of the type selected by the ObjectType argument.

Remarks

Use the RepaintObject method to complete any pending screen updates for a specified database object or for the active database object, if none is specified. Such updates include any pending recalculations for the object's controls.

Using the RepaintObject method with no arguments (the default constant, acDefault, is assumed for the ObjectType argument) repaints the active window.

The RepaintObject method of the DoCmd object was added to provide backwards compatibility for running the RepaintObject method in Visual Basic code in Microsoft Access 95. If you want to repaint a form, we recommend that you use the existing Repaint method of the Form object instead.

Example

The following example repaints the Customers table.

DoCmd.RepaintObject acTable, "Customers"

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.