Results 1 to 4 of 4

Thread: [RESOLVED] Time Checking

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Dec 2007
    Posts
    1,072

    Resolved [RESOLVED] Time Checking

    Code:
            If Val(Hour(Now)) = Val(txtHour.Text) Then
                If Val(Minute(Now)) = Val(txtMin.Text) Then
                     MsgBox "It's Time!"
                End If   
                     End If
    It don't work

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Time Checking

    A: What didn't work about it?
    B: What are you trying to do? What kind of time check are you after?

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Dec 2007
    Posts
    1,072

    Re: Time Checking

    I just want to check if the current hour and minute are the same as those entered.

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Time Checking

    Here is what I did as a test and it worked fine.
    Code:
    Option Explicit
    
    Private Sub Command1_Click()
    If Text1.Text = Label1.Caption Then
       MsgBox "Times are the same"
    Else
       MsgBox "Time is different"
    End If
    End Sub
    
    Private Sub Timer1_Timer()
    Label1.Caption = Format(Now, "m/dd/yyyy hh:mm")
    End Sub

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