G
Guest
I have a form w/ 3 bound fields and 1 unbound. We use scan guns to enter
barcodes into access. all scanning in done in the unbound field and based on
a prefix the data is moved to the correct bound field - no problem. When all
3 bound fields are filled in i want to move to a new record and start over
again. Any help on this part? I was toying with using MATH to update a
"value" and a case statment to evaluate the "value" and go to a newrecord
from there, but it doesn't work.
here is the code i have now in the afterupdate event of the unbound field.
Private Sub Text14_AfterUpdate()
Dim I
Dim scan As Variant
Dim check As Integer
Select Case check
Case Is = 1
GoTo inputloop
Case Is = 2
GoTo inputloop
Case Is = 3
DoCmd.GoToRecord , , acNewRec
End Select
inputloop:
Me.Text14.SetFocus
scan = Left$(Forms!CopyofFRM_SLABack.Text14, 2)
Select Case scan
Case Is = "DH"
If IsNull(Me.PSSN) Then
Me.PSSN = Me.Text14
check = check + 1
Else
Me.Text14.SetFocus
'Beep 280, 280
End If
Case Is = "BB"
If IsNull(Me.SLABack) Then
Me.SLABack = Me.Text14
check = check + 1
Else
Me.Text14.SetFocus
'Beep 280, 280
End If
Case Is = "AC"
If IsNull(Me.MBSN) Then
Me.MBSN = Me.Text14
check = check + 1
Else
Me.Text14.SetFocus
'Beep 280, 280
End If
Case Else
Me.Text14.SetFocus
For I = 1 To 3
'Beep 100, 100
Me.Text14.SetFocus
Next I
End Select
Me.Text14.Value = ""
End Sub
barcodes into access. all scanning in done in the unbound field and based on
a prefix the data is moved to the correct bound field - no problem. When all
3 bound fields are filled in i want to move to a new record and start over
again. Any help on this part? I was toying with using MATH to update a
"value" and a case statment to evaluate the "value" and go to a newrecord
from there, but it doesn't work.
here is the code i have now in the afterupdate event of the unbound field.
Private Sub Text14_AfterUpdate()
Dim I
Dim scan As Variant
Dim check As Integer
Select Case check
Case Is = 1
GoTo inputloop
Case Is = 2
GoTo inputloop
Case Is = 3
DoCmd.GoToRecord , , acNewRec
End Select
inputloop:
Me.Text14.SetFocus
scan = Left$(Forms!CopyofFRM_SLABack.Text14, 2)
Select Case scan
Case Is = "DH"
If IsNull(Me.PSSN) Then
Me.PSSN = Me.Text14
check = check + 1
Else
Me.Text14.SetFocus
'Beep 280, 280
End If
Case Is = "BB"
If IsNull(Me.SLABack) Then
Me.SLABack = Me.Text14
check = check + 1
Else
Me.Text14.SetFocus
'Beep 280, 280
End If
Case Is = "AC"
If IsNull(Me.MBSN) Then
Me.MBSN = Me.Text14
check = check + 1
Else
Me.Text14.SetFocus
'Beep 280, 280
End If
Case Else
Me.Text14.SetFocus
For I = 1 To 3
'Beep 100, 100
Me.Text14.SetFocus
Next I
End Select
Me.Text14.Value = ""
End Sub