It don't work :(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
Printable View
It don't work :(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
A: What didn't work about it?
B: What are you trying to do? What kind of time check are you after?
I just want to check if the current hour and minute are the same as those entered.
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