TimerInterval Property

Applies To

Form.

Description

You can use the TimerInterval property in to specify the interval, in milliseconds, between Timer events on a form.

Setting

The TimerInterval property setting is a Long Integer between 0 and 2,147,483,647 representing the interval, in milliseconds, between Timer events on a form.

You can set this property using the form’s property sheet, a macro, or Visual Basic.

When using Visual Basic, you set the TimerInterval property in the form’s Load event.

Remarks

Put Visual Basic code you want run at intervals specified by the TimerInterval property in the Timer event procedure for a form. For example, to requery records every 30 seconds, you can put code in the Timer event procedure for a form to requery the records, and then set the TimerInterval property to 30000.

See Also

Timer Event.

Example

The following example shows how to create a flashing button on a form by displaying and hiding an icon on the button. The form’s Load event procedure sets the form’s TimerInterval property to 1000 so the icon display is toggled once every second.


Sub Form_Load()
    Me.TimerInterval = 1000SubForm_Timer()
    Static intShowPicture As Integer
    If intShowPicture Then
        Me!btnPicture.Picture = "C:\Icons\Flash.ico"
    Else
        Me!btnPicture.Picture = Null        ' Don't show icon.
    End If
    intShowPicture = Not intShowPictureSub