|
-
Apr 13th, 2006, 07:43 AM
#1
Thread Starter
Frenzied Member
Run procedure at specific time
I have an application that runs 24/7 and there is a procedure in that project that can be run by the press of a button. However, it needs to be pushed at 7AM every morning and I want to automate that process (running the procedure).
I've throught about setting up a timer, but that has to check every minute for the time. Then I thought about splitting the procedure out into a small second app, but that complicates the installation elsewhere.
Does anyone know of a good way to do this?
-
Apr 13th, 2006, 07:58 AM
#2
Re: Run procedure at specific time
use a timer... nothing wrong with that.. used to do it all the time with access
set the timer interval to 30000 (30 seconds) or 60000(1 minute)
then test if the time > #7:00:00 AM# ....
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Apr 13th, 2006, 08:01 AM
#3
Thread Starter
Frenzied Member
Re: Run procedure at specific time
Ok... but every minute after 7AM, that's going to run. How do I only get it to run once? I'd have to set it so that if it's 7:00 and not worry about the seconds.
-
Apr 13th, 2006, 08:07 AM
#4
Re: Run procedure at specific time
well.. u cant set it to be
if time = 7.. cause there is the chance it will miss the exact time and not run
try somethinglike this...
you need to track the day and if it has run....
VB Code:
Dim currDate As Date
Dim RanIt As Boolean
Private Sub Form_Load()
currDate = Date
End Sub
Private Sub Timer1_Timer()
If currDate <> Date Then
RanIt = False
currDate = Date
End If
If Time > #7:00:00 AM# And Not RanIt Then
RanIt = True
'RUN CODE
End If
End Sub
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|