Wrox Programmer Forums
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 6th, 2006, 08:57 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
Default Bar Code Scanner

I have a project where I use a bar code scanner for customer number. Here's the problem:

When I scan the number, the scanner beeps, but I have to hit the enter key or the tab key for the process to execute. Does anyone know a way to determine that the scanner has read the number, so I can kick off my process automatically without any keyboard interaction?

Thanks in advance!

Kevin

dartcoach
__________________
dartcoach
 
Old October 6th, 2006, 11:13 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
Default

Thanks anyway guys. I got it figured out.

Kevin

dartcoach
 
Old December 1st, 2006, 12:42 PM
Registered User
 
Join Date: Dec 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Could you please let me know what you did to solve this. I'm tring to do the same thing.

Thanks,
Corinne

 
Old December 1st, 2006, 03:28 PM
Registered User
 
Join Date: Dec 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The scanner should send an end character of some kind, like a LF or CR. To see what your scanner is sending, create a VB exe, put two text boxes on it.

Then create:

Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
    Debug.Print KeyCode
End Sub

Run it and put the focus in the first text box. Scan an item. The Debug window will show the ascii characters received. The end character is the last one, probably = 10 or 13.

The reason for two text boxes is in case the last char is 9 - a tab. In that case, the second text box will have the focus once the scan is finished.



- Matt H
- http://blackbeltvb.com
 
Old December 1st, 2006, 10:13 PM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
Default

Corinne,

The way that I solved it was, with the scanner, there were different kinds of barcodes that it was capable of scanning, along with whether or not you wanted a carriage control, enter or tab code added to the end of the scan. Check the documentation for your scanner, it may have what you need.

Kevin


dartcoach





Similar Threads
Thread Thread Starter Forum Replies Last Post
how to integrate a hand-held bar code scanner suneet.pant Pro VB.NET 2002/2003 4 March 4th, 2008 06:06 AM
Hide Task bar through vb6 code akhilesh_g Pro VB 6 6 December 28th, 2007 01:23 PM
bar code+asp kumiko Classic ASP Basics 0 August 26th, 2006 10:30 AM
getting a cr with bar code scanner dbkester Access 9 April 21st, 2006 10:11 AM
Problem printing bar code! cyberrider VB How-To 1 November 5th, 2005 04:32 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.