Hi.
I have a simple form which contains a listbox and a textbox. the object of this form is to populate the listbox from data entered in the textbox. The data is barcodes that are scanned by a barcode scanner into the textbox. The problem is that after a barcode is scanned/entered, my code adds it to the listbox but never brings the focus back to the textbox so I can scan another barcode. I have to manually click on the textbox with the mouse. I want to just scan barcodes continuously without having to touch the mouse until I'm done. My code for this form is below. Any suggestions?
I have a simple form which contains a listbox and a textbox. the object of this form is to populate the listbox from data entered in the textbox. The data is barcodes that are scanned by a barcode scanner into the textbox. The problem is that after a barcode is scanned/entered, my code adds it to the listbox but never brings the focus back to the textbox so I can scan another barcode. I have to manually click on the textbox with the mouse. I want to just scan barcodes continuously without having to touch the mouse until I'm done. My code for this form is below. Any suggestions?
Code:
Private Sub TextBox1_AfterUpdate()
List0.AddItem Item:=TextBox1.Value
TextBox1.Value = ""
TextBox1.SetFocus
End Sub