SARProgrammer
Technical User
I am trying to force a user to enter a value > 0 in a combo box. MsgBox works fine, but focus goes to the textbox with the next tab index
I don't want the user to tab through without entering a valid value. I have been trying the following as an OnExit event (without success)
Private Sub CPR_Cert_LengthCombo_Exit(Cancel As Integer)
If CPR_Cert_LengthCombo = 0 Then
MsgBox "You must enter a value greater than zero", vbOKOnly + vbCritical, "Valid Card Length"
Me.CPR_Cert_LengthCombo.SetFocus
Else
CPR_Cert_Update
End If
End Sub
Thanks in advance
I don't want the user to tab through without entering a valid value. I have been trying the following as an OnExit event (without success)
Private Sub CPR_Cert_LengthCombo_Exit(Cancel As Integer)
If CPR_Cert_LengthCombo = 0 Then
MsgBox "You must enter a value greater than zero", vbOKOnly + vbCritical, "Valid Card Length"
Me.CPR_Cert_LengthCombo.SetFocus
Else
CPR_Cert_Update
End If
End Sub
Thanks in advance