need help with Military Time conversion
I'm trying to get a Military Time from the user's 2 inputs
Here is the code that works, but it's standard time.
VB Code:
Private Sub OKButton_Click()
If cboHour.Text <> "" Then
If cboMinute.Text <> "" Then
frmAlarmClock.lblSetTime.Caption = TimeSerial(Val(cboHour.Text), _
Val(cboMinute.Text), 0)
MyTime = TimeSerial(Val(cboHour.Text), Val(cboMinute.Text), 0)
frmAlarmClock.Enabled = True
frmAlarmClock.optOn.Enabled = True
frmAlarmClock.optOff.Enabled = True
Unload Me
End If
End If
End Sub
I tried this to make it Military Time, but it gave me a Type Mismatch error. How do I take 2 numerical values (inputed by the user) and make them come out as a Military time.
VB Code:
MyTime = Format(cboHour.Text) And (cboMinute.Text), "hh:mm:ss")
TIA