Run Macro 15 seconds after form loaded

pat_nospam

Registered User.
Local time
Today, 19:48
Joined
Oct 14, 2003
Messages
151
What's the best way to initiate a macro 15 seconds after a form is loaded, only once instead of the loop from the OnTimer form event.

TimerInterval = 15000
DoCmd.RunMacro "MacroName"

?

Is there a better way to do this? What's the best way to break the loop out so it only runs once?

TIA :)

Pat
 
Set TimerInterval to zero to disable it I think. You can do it right before you run the macro.
 
Sounds good - but if I put the DoCmd.RunMacro "blah" code in the OnTimer event, don't I need to set it to 15000 to run after 15 seconds. I just don't want to to keep running every 15seconds -- just to run once and then stop.


FoFa said:
Set TimerInterval to zero to disable it I think. You can do it right before you run the macro.
 
You could set it to 15000 in the form, so it will run once, than when it fires it's event, reset the interval to 0 first (so it does not run again) then run your macro. Of course evey time the form is opened this will run.
 
Have the macro make an entry with SetValue in an unbound text box and as its last action.

Then have a condtion for the macro that it only runs when that text box is null or have a StopMacro action at the start of the macro with condition that the text box is not null.

Mike
 
Mike375 said:
Have the macro make an entry with SetValue in an unbound text box and as its last action.

Then have a condtion for the macro that it only runs when that text box is null or have a StopMacro action at the start of the macro with condition that the text box is not null.

Mike
Mike, sorry but that again is a halfway solution. The better way is to "setvalue" the timer event to 0, this doesnt trigger the macro then anymore.

Also if you only want this thing to run once a day, you can make an entry in a table or something...

Regards
 
Thanks FoFa - worked like a charm. It was something that needed to run everytime the app was launched.

Thanks again
 

Users who are viewing this thread

Back
Top Bottom