-
I am trying to make something start at a specific time, but it is not working out. I have something like this:
If Format(Now, "hh:mm") > Hour(23) Then
{Whatever}
End If
I wanted this program to start at 11 o'clock at night if that is what the user choosed. That did not work. It just started the code as soon as it was done pausing for 8 minutes. Someone please help!
Joe
-
<?>
Code:
'add a timer to your project.
Option Explicit
Private Sub Command2_Click()
Shell "c:\program files\birthday reporter\birthdays.exe", vbNormalFocus
'Reenable the timer
Timer1.Enabled = True
End Sub
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub Form_Load()
Timer1.Enabled = True
Timer1.Interval = 60000 'approx 1 min
End Sub
Private Sub Timer1_Timer()
Dim curTime As Date
curTime = Format(Now, "hh:mm AMPM")
If curTime = "11:00 PM" Then
'disbale the timer and shell my program
Timer1.Enabled = False
Call Command2_Click
End If
End Sub