Prev: dgdsb
Next: What is Task?
From: John W. Vinson on
On Sat, 24 Apr 2010 04:40:01 -0700, Karren Lorr
<KarrenLorr(a)discussions.microsoft.com> wrote:

>Hello
>
>Is there a way to run a set of codes every 15 mins.
>eg.
>
>Private Sub FormButton_Click()
>Do something here
>wait 15 mins and then repeat the Do something here
>end sub
>
>Thank you
>
>
>

Open the form in design view and choose the Timer event. Edit your "do
something" code into that event.

Your form button would just set the form's Timer property to 15 minutes, in
milliseconds. Your click code could be:

Private Sub Form_Button_Click()
Me.Timer = 1000*60*15
Call Timer ' to have it "do something" the first time
End Sub

You'll need some way to turn it off (by just setting the form's Timer property
to 0).
--

John W. Vinson [MVP]
First  |  Prev  | 
Pages: 1 2
Prev: dgdsb
Next: What is Task?