I need a way to keep the users from continuing to the next field until the error has been corrected.
Here is one of the data validation rules that I have setup.
I was thinking of wrapping a do while loop around it or parts of it but can't seem to get it right.
Could someone show an example so that I could apply that to the rest of my code.
Thanks!!
Thanks
John Fuhrman
Here is one of the data validation rules that I have setup.
I was thinking of wrapping a do while loop around it or parts of it but can't seem to get it right.
Could someone show an example so that I could apply that to the rest of my code.
Thanks!!
Code:
Private Sub BoxNumber_BeforeUpdate(Cancel As Integer)
On Error GoTo Err_Handler
Dim dl As String
dl = vbNewLine & vbNewLine
If Len(Me.BoxNumber) < 14 Then
Select Case left(UCase(Me.BoxNumber.Value), 3)
Case UCase("nbc")
Exit Sub
Case "SRC", "LIN", "WAC", "EAC", "MSC"
Cancel = True
BeepWhirl
MsgBox Me.BoxNumber & " Appears to be a Reciept Number" & dl & _
"Please Correct the Tracking Number ...", _
vbExclamation + vbOKOnly, _
"ERROR!"
Exit Sub
Case Else
Cancel = True
BeepWhirl
MsgBox Me.BoxNumber & " is not a Valid Tracking Number" & dl & _
"Please Correct the Tracking Number ...", _
vbExclamation + vbOKOnly, _
"ERROR!"
Exit Sub
End Select
End If
endit:
Exit Sub
Err_Handler:
If StandardErrors(Err) = False Then
BeepWhirl
MsgBox Err & ": " & Err.Description
End If
Resume endit
End Sub
Thanks
John Fuhrman