entering data without the enter key

loriyklo
07-18-2001, 08:41 PM
I am designing a very simple form in MS Access for entering 2 pieces of data onto each record of a table. So this form has 2 textBoxes.

99% of the source data are labels with bar-codes. When the operator uses a barcode scanner to enter the data, he scans the 1st data onto textbox1, press the "enter key" on his keyboard, the cursor jumps to textbox2. He scans the 2nd piece of data onto textbox2, press "pagedown" key on the keyboard and start data entry for the next record. No problems so far.

Because the length of the 1st and 2nd field are FIXED, the operator wants me to use VBA programming to eliminate his needs of pressing the "enter" key & the "pagedown" key? At this moment I am planning of using the "keydown" event, the gotoControl method, gotoRecord method, plus some counters to handle this requirements.

Before I set out to do the above programming, do I have a simpler approach? As usual, all suggestions would be much appreciated.

KesleyK
07-19-2001, 09:30 AM
Can you set the focus to the next textbox on the Change event?

______
Cheers!

Thinker
07-19-2001, 09:32 AM
One thing to watch out for there, the change event will happen for every character.

Adi
07-19-2001, 09:57 AM
well, what you could do, is since it is a fixed lengh of field, you can count the number of characters in the textbox on the change event determening whether the box is filled fully with an if function. if it is, then you can jump to the next record or box.

Hope this helps

Adi

KesleyK
07-19-2001, 10:05 AM
True, and Ad1's check would also work, but since the data is being placed in on scan, will the character-by-character change event fire? If so, then change will definitely NOT be the way to go since it will probably force the user to scan once for every character. However, if it doesn't fire until after the entire scan, this would be the pie.

______
Cheers!

loriyklo
07-20-2001, 12:10 AM
After receiving all your input I conclude Access does not have a so-called "auto-complete" function after a certain no. of character is entered for a text box.

I have no alternatives but to write some codes to handle this requirement. In fact I have just finished doing it and it seems to work fine.

I did not try the change Event. I achieve by using two event handlers: one for key-Down and one for key-Press. (as Adi suggests, in the key-Press event handler, I count the no. of key pressed. Complete a field and jump to another box/record when the count reaches).

I want the form to be able to work in 2 modes: normal mode and scan mode. In normal mode, the form has no difference to a standard one. In scan mode, it does the auto-complete function. This is one reason I need the key-down event handler.

FYI, I make normal mode to switch to scan mode after pressing 'Esc'. I make scan mode to switch to normal by pressing the 'contrl' key.

Thanks to all who provide input.

KesleyK
07-20-2001, 09:15 AM
np, and as long as it works it can't be wrong.

______
Cheers!

kcwallace
07-20-2001, 09:31 AM
I have written apps for >10 different types of BC scanners, and have never seen one that does not end every scan with a hard return. Therefore, automatically advancing to the next field in Access. Maybe there is a setting on the scanner to change. Or, if it is an option, try new bar-code scanners.

loriyklo
07-22-2001, 05:13 PM
A good point. I'll investigate.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum