Good morning all,
I have a form used for dataentry from a scangun. 4 field A, B, C, D. A = an unbound text field, where I want all the scanning to go on. I have code to check the value of what is scanned and move it to either B, C, or D, based on a prefix. no problem there.
Question 1: If no prefix matches then go back to field A for another scan, I need it to overwrite the old data that was scanned in. not sure how to do this.
Question 2: once all 3 fields B, C, D are no longer null move to the next record.
could you take a look at my code ( still new to VBA) and maybe help out alittle?
Thanks
Kevin
Private Sub Text14_AfterUpdate()
Dim I
inputloop:
Forms![FRM_SLA Back]!Text14.SetFocus
If Me.Text14 Like "DH*" Then
Me.PSSN = Me.Text14
ElseIf Me.Text14 Like "AC*" Then
Me.MBSN = Me.Text14
ElseIf Me.Text14 Like "BB*" Then
Me.SLABack = Me.Text14
Else
For I = 1 To 3
Beep 100, 150
Next I
Forms![FRM_SLA Back]!Text14.SetFocus
End If
If Me.PSSN = Null Then
GoTo inputloop
ElseIf Me.MBSN = Null Then
GoTo inputloop
ElseIf Me.SLABack = Null Then
GoTo inputloop
End If
End Sub
I have a form used for dataentry from a scangun. 4 field A, B, C, D. A = an unbound text field, where I want all the scanning to go on. I have code to check the value of what is scanned and move it to either B, C, or D, based on a prefix. no problem there.
Question 1: If no prefix matches then go back to field A for another scan, I need it to overwrite the old data that was scanned in. not sure how to do this.
Question 2: once all 3 fields B, C, D are no longer null move to the next record.
could you take a look at my code ( still new to VBA) and maybe help out alittle?
Thanks
Kevin
Private Sub Text14_AfterUpdate()
Dim I
inputloop:
Forms![FRM_SLA Back]!Text14.SetFocus
If Me.Text14 Like "DH*" Then
Me.PSSN = Me.Text14
ElseIf Me.Text14 Like "AC*" Then
Me.MBSN = Me.Text14
ElseIf Me.Text14 Like "BB*" Then
Me.SLABack = Me.Text14
Else
For I = 1 To 3
Beep 100, 150
Next I
Forms![FRM_SLA Back]!Text14.SetFocus
End If
If Me.PSSN = Null Then
GoTo inputloop
ElseIf Me.MBSN = Null Then
GoTo inputloop
ElseIf Me.SLABack = Null Then
GoTo inputloop
End If
End Sub