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 A 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

You can 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, it's recommended that you use the existing Repaint method of the Form object instead.

Example

The following example repaints the table Customers:

DoCmd.RepaintObject acTable, "Customers"

See also

DoCmd Object