am trying to validate the the time to be in this format .. the code is correct except the last if statement.. i want it to check that the ":" is the third digit from the right ..
///////////////
If Len(Text1.Text) < 4 Then
MsgBox ("Time should be in this formate 0:00"
Else
If InStr(Text1, ":"
= 0 Then
MsgBox ("Time should be in this formate 0:00"
Else
If InStr(":", Left(Trim(Text1), 1)) <> 0 Then
MsgBox ("Time should be in this formate 0:00"
Else
If InStr(":", Right(Trim(Text1), 1)) <> 0 Then
MsgBox ("Time should be in this formate 0:00"
Else
If InStr(":", Right(Trim(Text1), 3)) <> 0 Then
MsgBox ("Time should be in this formate 0:00"
End If
End If
End If
End If
End If
///////////
///////////////
If Len(Text1.Text) < 4 Then
MsgBox ("Time should be in this formate 0:00"
Else
If InStr(Text1, ":"
MsgBox ("Time should be in this formate 0:00"
Else
If InStr(":", Left(Trim(Text1), 1)) <> 0 Then
MsgBox ("Time should be in this formate 0:00"
Else
If InStr(":", Right(Trim(Text1), 1)) <> 0 Then
MsgBox ("Time should be in this formate 0:00"
Else
If InStr(":", Right(Trim(Text1), 3)) <> 0 Then
MsgBox ("Time should be in this formate 0:00"
End If
End If
End If
End If
End If
///////////