I'm using a masked edit box to prompt the user for a time value. I am having trouble validating that the user entered a correct value. My input mask is: ##:##:## and my format mask is "hh:mm:ss AM/PM". The problem is that the user has to enter a military time for the edit box to recognize a PM time. How can I prompt the user to add ##:##:## plus specify AM or PM and then format the user input.


My validation routine looks like this:


Private Sub mskTimeLow_Validate(Cancel As Boolean)
If Len(mskTimeLow.Text) < 6 Then
If IsNumeric(mskTimeLow.Text) Then
Do Until Len(mskTimeLow.Text) >= 6
mskTimeLow.Text = mskTimeLow.Text & "0"
Loop
Else
mskTimeLow.Text = CInt(mskTimeLow.Text)
End If

End If
'verify that it is in fact a time
If IsDate(mskTimeLow.FormattedText) Then
'MsgBox "This is a date" & mskTimeLow.FormattedText
'okay
Else
MsgBox "Invalid date: " & mskTimeLow.FormattedText
Cancel = True
Exit Sub
End If

End Sub


but like I said, how do I prompt the user to specify AM/PM. I do not want to force the user to enter military time.

Anyone?