Better ways to schedule? 
Author Message
 Better ways to schedule?

I am using the Timer control to schedule a once-a-day procedure. Since the
timer only knows interval of 1 minute or so, I have to have it check the time
every minute. The timer routine goes like this:
--------------------------------
Private Sub TimerDay_Timer()    'TimerDay.interval=6000
'wakes up once a day at specified time
Dim dtmHourSet As Integer

dtmHourSet = Val(frmMain.lstTime.Text)

If Hour(Now) = dtmHourSet And Minute(Now) >= 0 And Minute(Now) < 2 Then

    frmMain.File1.Refresh
    If frmMain.File1.ListCount > 0 Then
        cmdProcessNow_Click
    End If

End If

End Sub
--------------------------------------
This apparently is not elegant. Would anyone suggest a better way.


Fax: +1-610-974-2809
Voice:  610-691-5468



Sun, 04 Jun 2000 03:00:00 GMT  
 Better ways to schedule?

Hi,

  Why aren't you using the Date or Time function of VB? Each Time-Value is unique
each day, so you can even specify a precise time to start your backup.

Hendrik

Quote:

> I am using the Timer control to schedule a once-a-day procedure. Since the
> timer only knows interval of 1 minute or so, I have to have it check the time
> every minute. The timer routine goes like this:
> --------------------------------
> Private Sub TimerDay_Timer()    'TimerDay.interval=6000
> 'wakes up once a day at specified time
> Dim dtmHourSet As Integer

> dtmHourSet = Val(frmMain.lstTime.Text)

> If Hour(Now) = dtmHourSet And Minute(Now) >= 0 And Minute(Now) < 2 Then

>     frmMain.File1.Refresh
>     If frmMain.File1.ListCount > 0 Then
>         cmdProcessNow_Click
>     End If

> End If

> End Sub
> --------------------------------------
> This apparently is not elegant. Would anyone suggest a better way.


> Fax: +1-610-974-2809
> Voice:  610-691-5468



Sun, 04 Jun 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. dropdownlists and grids, which ways is the best?

2. good ways to use recordsets without autocommit?

3. good ways to use recordsets without autocommit?

4. Better ways to put text into textbox??

5. Searching for a good schedule control

6. Calendar / Scheduling Algorithm - A better way please!

7. Good DTS Pack Fails When Scheduled

8. the best Schedule Controls for .net

9. Good Calendar/Scheduling add-in/control

10. A good, better, best idea

11. Ways to code - Performance

12. Different ways to open a Recordset

 

 
Powered by phpBB® Forum Software