It's Friday and I know my brain is already in weekend mode so please forgive me for this request for assistance.
I have a field on a form that data is scanned into and on exit I check to insure the scan is valid. If it is not valid then I want to clear the field and set the focus to that field to have the data rescanned.The cursor goes to the next field.
Any help is greatly appreciated.
The code is as follows.
Private Sub Chair_Exit(Cancel As Integer)
Dim lngRetval As Long
If Left(Forms!frm_RecordWork!Product, 2) <> "SH" Or Left(Forms!frm_RecordWork!Product, 2) <> "UC" Then
lngRetval = MsgBox( _
"Not a valid Product." & vbCrLf & "Rescan" & vbCrLf & "", _
vbOKOnly + vbExclamation + vbDefaultButton1, _
"Bad Scan")
Select Case lngRetval
Case vbOK
Me!Product.SetFocus
End Select
End If
End Sub
Razor1
I have a field on a form that data is scanned into and on exit I check to insure the scan is valid. If it is not valid then I want to clear the field and set the focus to that field to have the data rescanned.The cursor goes to the next field.
Any help is greatly appreciated.
The code is as follows.
Private Sub Chair_Exit(Cancel As Integer)
Dim lngRetval As Long
If Left(Forms!frm_RecordWork!Product, 2) <> "SH" Or Left(Forms!frm_RecordWork!Product, 2) <> "UC" Then
lngRetval = MsgBox( _
"Not a valid Product." & vbCrLf & "Rescan" & vbCrLf & "", _
vbOKOnly + vbExclamation + vbDefaultButton1, _
"Bad Scan")
Select Case lngRetval
Case vbOK
Me!Product.SetFocus
End Select
End If
End Sub
Razor1