How can I allow a user to enter some text in a Textbox
React to that text in the Afterupdate, or Lost Focus Event and then clear the text and keep the focus in the Textbox ready for the next input?
Only not reacting to the text when the input is "" or NULL
I have the following but it does not work because you can not Setfocus within it's own Afterupdate or Lostfocus event.
Private Sub txtBarCode_AfterUpdate()
React to that text in the Afterupdate, or Lost Focus Event and then clear the text and keep the focus in the Textbox ready for the next input?
Only not reacting to the text when the input is "" or NULL
I have the following but it does not work because you can not Setfocus within it's own Afterupdate or Lostfocus event.
Private Sub txtBarCode_AfterUpdate()
If txtBarCode.Value <> "" And Not IsNull(txtBarCode.Value) Then
If FindBarCode(txtBarCode.Value) Then
Call AddProductToBasket
Else
MsgBox "No Barcode Available For This Product", vbOKOnly, "Scan Item Error"
End If
txtBarCode.Value = ""
txtBarCode.SetFocus
End If
End Sub
Last edited: