Form.Timer Event (Access)

The Timer event occurs for a form at regular intervals as specified by the form's TimerInterval property.

Syntax

.Timer

A variable that represents a Form object.

Remarks

To run a macro or event procedure when this event occurs, set the OnTimer property to the name of the macro or to [Event Procedure].

By running a macro or event procedure when a Timer event occurs, you can control what Microsoft Access does at every timer interval. For example, you might want to requery underlying records or repaint the screen at specified intervals.

The TimerInterval property setting of the form specifies the interval, in milliseconds, between Timer events. The interval can be between 0 and 2,147,483,647 milliseconds. Setting the TimerInterval property to 0 prevents the Timer event from occurring.

Link provided by:커뮤니티 구성원 아이콘 The UtterAccess community | About the Contributors

Example

The following example demonstrates a digital clock you can display on a form. A label control displays the current time according to your computer's system clock.

To try the example, add the following event procedure to a form that contains a label named Clock. Set the form's TimerInterval property to 1000 milliseconds to update the clock every second.

Private Sub Form_Timer() 
    Clock.Caption = Time        ' Update time display. 
End Sub 

About the Contributors

UtterAccess(영문일 수 있음)는 Microsoft Access 위키 및 도움말 포럼입니다. 가입하려면 여기를 클릭하십시오(영문일 수 있음).

참고 항목

개념

Form Object

Form Object Members