jcaptchaos2
Well-known Member
- Joined
- Sep 24, 2002
- Messages
- 1,032
- Office Version
- 365
- Platform
- Windows
I have a form were the employee scans a bar code and it will enter the data into a table, the code below helps so the employee only has to scan 1 bar code instead of 3. What is happening is that some employees are typing in the information instead of scanning it and it is resulting in incorrect data. I have changed all of the entry boxes to combo boxes allowing me to block invalid item or shop order numbers from being entered. The issue I have now is that a shop order number is being entered with a wrong item number, the shop order number is assigned to a specific Item number.I need to come up with something that would block that from happening. I have a table named "shoporderstatus" that has the item number and shop order number matched up. Is there a way lets say in the "Shop order Number" combo box after event that I could have it flag that the item number doesn't match up with the shop order number?
Code:
Private Sub Item_number_AfterUpdate()
Static abort As Boolean
If abort Then abort = False: Exit Sub
Shop_Order_Number = Mid(Item_Number, 6, 5)
Op_Number = Mid(Item_Number, 11)
abort = True
Item_Number = Mid(Item_Number, 1, 5)
End Sub