Repaint Method
The Repaint method completes any pending screen updates for a specified form. When performed on a form, the Repaint method also completes any pending recalculations of the form's controls.
expression.Repaint
expression Required. An expression that returns one of the objects in the Applies To list.
Remarks
Microsoft Access sometimes waits to complete pending screen updates until it finishes other tasks. With the Repaint method, you can force immediate repainting of the controls on the specified form. You can use the Repaint method:
- When you change values in a number of fields. Unless you force
a repaint, Microsoft Access might not display the changes immediately,
especially if other fields, such as those in an expression in a calculated
control, depend on values in the changed fields.
- When you want to make sure that a form displays data in all of its fields. For example, fields containing OLE objects often don't display their data immediately after you open a form.
This method doesn't cause a requery of the database, nor does it show new or changed records in the form's underlying record source. You can use the Requery method to requery the source of data for the form or one of its controls.
Notes
- Don't confuse the Repaint method with the Refresh
method, or with the Refresh command on the Records menu. The Refresh
method and Refresh command show changes you or other users have made
to the underlying record source for any of the currently displayed records
in forms and datasheets. The Repaint method simply updates the screen
when repainting has been delayed while Microsoft Access completes other
tasks.
- The Repaint method differs from the Echo method in that the Repaint method forces a single immediate repaint, while the Echo method turns repainting on or off.
Example
The following example uses the Repaint method to repaint a form when the form receives the focus:
Private Sub Form_Activate()
Me.Repaint
End Sub