View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Thomas Lutz Thomas Lutz is offline
external usenet poster
 
Posts: 42
Default Textbox & Barcode Scanning

All you need is a bar code scanner that has a keyboard wedge
interface.
You can program all bar code scanners that have a keyboard wedge
interface to issue an "enter" keystroke after every bar code that you
scan. (This is the default behavior of most scanners.)
You could then use code in your userform that will respond to the
"enter" key and write the data from the textbox to the bottom of a
column and then clear out the textbox and wait for the next scan.

You could use code like the following in your userform:

Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger,
ByVal Shift As Integer)
If KeyCode = 13 Then
KeyCode = 0
R = Sheets(1).Cells(65000, 1).End(xlUp).Row
If Len(Sheets(1).Cells(R, 1).Text) Then R = R + 1
Sheets(1).Cells(R, 1).Value = TextBox1.Text
TextBox1.Text = ""
End If

End Sub

If you need a good bar code scanner that has a keyboard wedge
interface at a very good price, please visit:
http://www.taltech.com/products/bc_reader.html


On Tue, 24 Feb 2004 07:00:48 -0800, "Michael Carroll"
wrote:

What I want to do is this: Have a userform with a textbox
which will receive information via a scan of a barcode. I
want to have this info sent to a spreadsheet, the textbox
cleared and ready for the next scan. The problem I'm
having is this...I don't want the user to have to do
anything but scan. Ideally, the user should be able to
scan, wait for a 'ding' (a good, clean scan), scan the
next barcode, etc. Ultimately, a list of barcodes will
printout. Any help would be greatly appreciated.

Thanks!
Michael Carroll