Results 1 to 2 of 2

Thread: Time Comparision

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2000
    Posts
    1

    Angry

    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

  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    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
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width