I have built a Barcode scanning program and Im having trouble with a part of the functionality.
What it is supposed to do: A user will scan a barcode and that number is stored into a table if it is unique. If it is not unique then I want to open a new form.
This is the code I have for the text field, which uses a query to search for the entered value.
Private Sub Form_BeforeUpdate(Cancel As Integer)
[txtTest] = DLookup("[Barcode Number]", "SearchNew")
If IsNull(txtTest.Value) Then
'add record
Else
'Open another form and ask for user input
I keep getting a error message from access about it being a duplicate
How do I bypass this message.
Thanks in advance
What it is supposed to do: A user will scan a barcode and that number is stored into a table if it is unique. If it is not unique then I want to open a new form.
This is the code I have for the text field, which uses a query to search for the entered value.
Private Sub Form_BeforeUpdate(Cancel As Integer)
[txtTest] = DLookup("[Barcode Number]", "SearchNew")
If IsNull(txtTest.Value) Then
'add record
Else
'Open another form and ask for user input
I keep getting a error message from access about it being a duplicate
How do I bypass this message.
Thanks in advance