Bar Code Scanners

joe.sims

Registered User.
Local time
Today, 06:03
Joined
Dec 9, 2004
Messages
13
We have a new project coming up so I have created a simple Access database. Due to the enormouns amount of data entry we are going to be using bar code scanners. But this is the problem, when you enter data using a bar code scanner and want to move to the next field the enter key has to be hit. Is there a way that I can code the db to automatically move to the next field when data has been entered.

Joe
 
Is there a way that I can code the db to automatically move to the next field when data has been entered.

Access, like most Windows programs, works off of Events. KeyPress is an event that it understands. The question that we have to ask of you is whether the connection used by the bar code scanner includes a usable event that Windows will recognize. Without a usable event, your answer is probably NO.

Now, you COULD consider this as a way to FORCE an event, but it depends on the reliability of the scanner and a way to know that you have seen the entire bar code.

If you are doing data entry from a form, you can use the GotFocus event of the bar code field to start a timer, then use the Form's OnTimer event to repeated read the code presented by the scanner. If this code is stable over a sequence of some number of scans at least several milliseconds apart (and I'm not talking about several = 2 or 3), the code might be stable. Or, if the scanner won't even PRESENT a code unless it has seen a complete code, you can use that fact.

Compare the code from the scanner vs. the .OldValue of the scan-code field. If they are the same AND the scanner is giving positive feedback of having seen something, you have nothing to store. If they are different, you can store the new value.

In either case, when you are satisified with the current/new contents of the control, sound a beep and do a .SetFocus to the next control.
 
Your TAB order should be set in View-->Tab Order.
Then after scanning you can add: SendKeys "{+TAB}" which goes to the next control for scanning.
 
Wouldn't it be easier to change the focus to the next field using the AfterUpdate event?

me![FieldName].setfocus
 
most barcode scanners should be programmable to automatically add a carriage return or other special keystrokes after each scan
 
Use autotab and input mask

I use the following to rapidly input survey data from keyboard, but it might work with barcode reader as well. Benefit is that it goes to next field without need for carriage return etc.

In the textbox that holds your input:
Set Autotab to Yes
Set input mask to 9;;_ (this is for 1 character, you'll want more depending on bar code format)
Set your tab stops to correct order. You don't need to set focus to another input field; automatically happens.
.After last input, set focus back to barcode input field.
 
rpadams - good point!

If the barcode is fixed-length, fulfilling the field's input mask automatically steps to the next field. I'd forgotten about that feature, so rarely have I ever had to use it. But you are spot-on with the suggestion.
 
xenologer said:
most barcode scanners should be programmable to automatically add a carriage return or other special keystrokes after each scan

This is the answer to your problem!

Make sure you buy the right sort of bar code scanner, the ones I have used are the keyboard type where a wedged shaped cable conector connects the barcode scanner into your computer via the keyboard port so the bar code scanner works just like a keyboard input. You can easily set the Bar code scanner to automatically add the enter key as the final keystroke.

This is simply programmed into the bar code scanner by scanning bar codes in the bar code scanner manual.

There are also available bar code scanners that connect directly to a com port on your computer. I have not used these but I do understand that you the programmer would have far more control over their function.
 

Users who are viewing this thread

Back
Top Bottom