Hi. This is my first post and i'm a newbie. I'm learning to use VB6 and i'm trying to create a simple alarm clock but having a type mismatch error. It seems that the input time does not match the clock time. i have here the code. Hope u can help me out.
Option Explicit
Dim StartTime As Variant
Dim EndTime As Variant
Dim ElapsedTime As Variant
Private Sub cmdEnd_Click()
'Find the ending time, compute the elapsed time
'Put both values in label boxes
EndTime = txtset.Text
lblEnd.Caption = Format(EndTime, "hh:mm:ss")
ElapsedTime = lblEnd.Caption - StartTime
If ElapsedTime = 0 Then
lblElapsed.BackColor = vbYellow
Beep
End If
lblElapsed.BackColor = vbRed
End Sub
Private Sub cmdExit_Click()
End
End Sub
Private Sub cmdStart_Click()
'Establish and print starting time
StartTime = Now
lblStart.Caption = Format(StartTime, "hh:mm:ss")
lblEnd.Caption = ""
lblElapsed.Caption = ""
End Sub
Private Sub Text1_Change()
End Sub
Private Sub timTimer1_Timer()
StartTime = Now
lblStart.Caption = Format(StartTime, "h:mm:ss ")
End Sub
Private Sub txtset_Change()
EndTime = txtset.Text
lblEnd.Caption = Format(EndTime, "hh:mm:ss")
End Sub