i have some code that i need to run the sendkeys ({"esc}") on to clear out the drop down not in list.
It is a shared dropdown so client can type in drop down to find item (dog food, cat food etc.) or you can scan barcode into it and if not in list it goes to code below and picks up the barcode and puts the item into the invoice items to be paid for.
if i don't hit escape the dropdown stays open with the list of products and you have to click out of it to close. i've tried to move the focus but only thing works is the esc key that i could find. now not for all machines but some it seems to turn off the num lock on the computer after running the send keys so i used the send keys
Sendkeys ("{NUMLOCK}"), True to see if that will make sure it is on but doesn't work does anyone have a possible solution for this?
It is a shared dropdown so client can type in drop down to find item (dog food, cat food etc.) or you can scan barcode into it and if not in list it goes to code below and picks up the barcode and puts the item into the invoice items to be paid for.
if i don't hit escape the dropdown stays open with the list of products and you have to click out of it to close. i've tried to move the focus but only thing works is the esc key that i could find. now not for all machines but some it seems to turn off the num lock on the computer after running the send keys so i used the send keys
Sendkeys ("{NUMLOCK}"), True to see if that will make sure it is on but doesn't work does anyone have a possible solution for this?
Code:
Private Sub sku_NotInList(NewData As String, Response As Integer)
DoCmd.SetWarnings False
On Error Resume Next
Response = acDataErrContinue
'Debug.Print NewData
If Me.handScanner = 1 Then
NewData = Right(Left(NewData, Len(NewData) - 1), Len(Left(NewData, Len(NewData) - 1)) - 1)
Else
NewData = Right(Left(NewData, Len(NewData)), Len(Left(NewData, Len(NewData))))
End If
[ProductNum] = DLookup("ItemID", "alias", "[Alias]='" & NewData & "'")
Me.sku = Null
Refresh
Dim probar
probar = DLookup("id", "productbar1")
Select Case True
Case Nz(probar, 0) = 0
Dialog.Box "We can not find the item in the list please try again!" & vbNewLine & vbNewLine & _
"If you still can't find your item it may have not scanned it in to the system " & _
"correctly under (Barcode or UPC Code) in add edit products.", _
vbCritical, "Error...Can't find item!"
payfastbar
Case [OutStockBlock] = True, _
Nz([Invx], 0) >= 1
Forms!restaraunt.payfastbarx
Case Nz([Invx], 0) < 1 And Dialog.Box("You are out of Stock in your inventory do you want to add this anyways?", vbYesNo + vbCritical, "Please confirm:") = vbYes
Forms!restaraunt.payfastbarx
End Select
Me.sku = Null
'Sendkeys ("{Enter}")
Pause 0.1
Sendkeys ("{esc}")
Sendkeys ("{NUMLOCK}"), True
invask
DoCmd.SetWarnings True
End Sub