How to select form button automatically after 10 seconds

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
message
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?

You can use's the form's Timer event to cause something to happen after
10 seconds. Set the Timer Interval to 10000, and create an Event
procedure to directly call the event procedure for the "Replace Name"
button. If that button has a macro for its OnClick event instead of an
event procedure, then run that macro directly using DoCmd.RunMacro,
instead.

There's one more thing you're going to want to do, if this form is still
going to be open after any of the buttons is clicked. In the event
procedures or macros called by those buttons, you're going to want to
set the form's TimerInterval to 0, so that the Timer event doesn't fire
when it shouldn't and run an unwanted process.
 
Back
Top