jcaptchaos2
Registered User.
- Local time
- Yesterday, 23:07
- Joined
- Apr 28, 2011
- Messages
- 12
Hello,
I have this code that when the cursor is in the combo box and scans the bar code it leaves the left 5 numbers in the combo box and then drops the next 3 down to the next text box. It works fine with the limit to list set to no in the (shop order number) combo box. I really need it to limit to that list as sometimes they employee may not scan the bar code but type it in by hand. The code fails because the Shop order number is 8 digits long when it is first scanned but the code brings the 3 digits down the the next text box. Is there a way around this?
I have this code that when the cursor is in the combo box and scans the bar code it leaves the left 5 numbers in the combo box and then drops the next 3 down to the next text box. It works fine with the limit to list set to no in the (shop order number) combo box. I really need it to limit to that list as sometimes they employee may not scan the bar code but type it in by hand. The code fails because the Shop order number is 8 digits long when it is first scanned but the code brings the 3 digits down the the next text box. Is there a way around this?
Code:
Private Sub Shop_Order_Number_AfterUpdate()
Static abort As Boolean
If abort Then abort = False: Exit Sub
Op_Number = Mid(Shop_Order_Number, 6, 3)
abort = True
Shop_Order_Number = Left(Shop_Order_Number, 5)
Item_Number = DLookup("[itemnumber]", "[shoporderstatus]", "[shoporderstatus]![shopordernumber]= " & [Forms]![Shop Floor Data Entry]![Shop Order Number])
End Sub