How to automatically select form button after 10 seconds

  • Thread starter Thread starter antigone
  • Start date Start date
A

antigone

I have a form that has four different buttons. The buttons do different
things with an Access Table. What I am trying to do is select one of the
options automatically if the user does not select an option in a certain
period of time...say 10 seconds.

Let's say my form has 4 buttons "Replace name" "Replace Address" "Replace
Sex" "Replace Favorite Food" The form is in a Macro and automatically opens
when the macro is executed. I want to form to automatically select "Replace
Name" if the user does not select another button in the specified time.

Is there any way to do this?
 
What you would have to do, is in the Form_Open event, set the forms timer
interval to 10 seconds (or 10,000 miliseconds).

Private Sub Form_Open()

' Set the timer interval
Me.TimerInterval = 10000

End Sub

Now, any code placed in the forms On_Timer sub will run every 10 seconds. If
you want the sub to only run once, reset the TimerInterval property.

Private Sub Form_Timer()

'**Code to set default button**

' Reset the timer interval
Me.TimerInterval = 0

End If

HTH,

Neil.
 
Back
Top