Painting Property

Applies To

Form, Report.

Description

You can use the Painting property to specify whether forms or reports are repainted.

Setting

The Painting property uses the following settings.

Setting

Description

True

(Default) The form or report is repainted.

False

The form or report isn’t repainted.


You can set this property using only a macro or Visual Basic.

This property applies only in Form view and is unavailable in other views.

Remarks

The Painting property is similar to the Echo action. However, the Painting property prevents repainting of a single form or report, whereas the Echo action prevents repainting of all open windows in an application.

Setting the Painting property for a form or report to False also prevents all controls (except subform or subreport controls) on a form or report from being repainted. To prevent a subform or subreport control from being repainted, you must set the Painting property for the subform or subreport to False. (Note that you set the Painting property for the subform or subreport, not the subform or subreport control.)

See Also

Echo Action.

Example

The following example uses the Painting property to enable or disable form painting depending on whether the SetPainting variable is set to True or False. If form painting is turned on, Microsoft Access displays the hourglass icon while repainting.


Function EnablePaint(frmName As Form, ByVal SetPainting As Integer) As _
        Integer
    frmName.Painting = SetPainting
    If SetPainting = False Then        ' Form painting is turned off.
        DoCmd.Hourglass True            ' Display icon.
    Else
        DoCmd.Hourglass False        ' Don't display icon.
    End IfFunction