dale_j1992
Registered User.
- Local time
- Today, 17:27
- Joined
- Sep 23, 2016
- Messages
- 26
Morning All ,
I Hope everyone is well.
I am still fairly new to access, and not a frequent user so go steady on me please.
With a current database i have this piece of VBA code that checks a barcode has been entered on the previous station/table before you can scan in on the current station.
We now however have a certain part number that doesn't get scanned at a station is there a way to edit the code below to achieve this.
Private Sub TxtBarInp_BeforeUpdate(Cancel As Integer)
Dim Answer As Variant
Answer = DLookup("[BARCODE]", "tbllogGEARCUTTING", "[BARCODE] = '" & TxtBarInp & "'")
If IsNull(Answer) Then
MsgBox "CRANKSHAFT HAS NOT BEEN SIGNED OFF AT GEARCUTTING CELL" & vbCrLf & "Please Contact your T.LEADER.", vbCritical + vbOKOnly + vbDefaultButton1, "Duplicate"
Cancel = True
Me.TxtBarInp.Undo
End If
End Sub
The Barcode we are scanning is 12 digit 110007312345, the first 7 digits are the part number and the following 5 the unique identifier.
its the 1100073 part number that i want the code to exclude from the check on this station.
Many thanks in advance for any help.
Kind regards
Dale
I Hope everyone is well.
I am still fairly new to access, and not a frequent user so go steady on me please.
With a current database i have this piece of VBA code that checks a barcode has been entered on the previous station/table before you can scan in on the current station.
We now however have a certain part number that doesn't get scanned at a station is there a way to edit the code below to achieve this.
Private Sub TxtBarInp_BeforeUpdate(Cancel As Integer)
Dim Answer As Variant
Answer = DLookup("[BARCODE]", "tbllogGEARCUTTING", "[BARCODE] = '" & TxtBarInp & "'")
If IsNull(Answer) Then
MsgBox "CRANKSHAFT HAS NOT BEEN SIGNED OFF AT GEARCUTTING CELL" & vbCrLf & "Please Contact your T.LEADER.", vbCritical + vbOKOnly + vbDefaultButton1, "Duplicate"
Cancel = True
Me.TxtBarInp.Undo
End If
End Sub
The Barcode we are scanning is 12 digit 110007312345, the first 7 digits are the part number and the following 5 the unique identifier.
its the 1100073 part number that i want the code to exclude from the check on this station.
Many thanks in advance for any help.
Kind regards
Dale