Automatic field advance

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am attempting to construct an inventory system that captures a string of
numbers via a barcode scanner. Within the number string is several pieces of
data. I need to separate the number string (i.e. first 4 digits in one field,
next 3 in another) automatically so that as the scanner reads the number
string it is separated for interpretation. I've seen this type of thing
happen when inputting data into web pages. For example, when typing a SSN or
phone number the cursor automatically advances to the next field. Please help.

Thanks.
 
Hi Aaron,

For keyboard entry via a form, you can do this as follows:

1) set an Input Mask on the first textbox to constrain it to the
appropriate number of characters, e.g.
####
for 4 digits.

2) set its AutoTab property; this causes focus to switch to the next
control in the form's tab order when the last character in the input
mask has been "filled".

Most barcode readers work by imitating a keyboard, so the same technique
might work. An alternative, which I feel would be safer (though I've
never used a barcode reader with Windows) might be to have a single
textbox into which you let the reader import the entire string of digits
(e.g. "1234567"). Then, in the textbox's AfterUpdate event procedure,
have code that checks the data and if it's acceptable splits it into
chunks and places each chunk in the appropriate field.

On Thu, 24 Aug 2006 10:06:02 -0700, Aaron Petersen <Aaron
 
Back
Top