Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto tabbing to next control??

Status
Not open for further replies.

rudolphjk

MIS
Aug 23, 2001
18
US
I'm developing a very simple access database form, and want to be able to enter data by using a handheld barcode scanner. I also do not want the user to have to press any keys on the keyboard, but just cycle through the 3 fields by using the barcode scanner. I'm trying to figure out how to move to the next control on the form. The data being entered into the fields are of no set lengths.

I've tried using the "OnChange" event with a "GoToControl" macro to get to the next control on the form, but the focus goes to the next control on the form after only 1 character is sent (typically, the field should be around 8 characters long).

Also, the barcodes have been pre-printed, so there is no way to sneak a tab control into the barcode.
Any ideas/help appreciated.

Thanks.
 
this maybe a shot in the dark but perhaps you can check the length of the data witin the field prior to it settingfocus on the next field.

sub field1_onchange()

if len(field1.value) > 8 then
field2.setfocus
else
end if

exit sub
 
Is there a way to add a 1-second pause before executing the onchange event? Assuming the scanning of a barcode takes less than 1 second to perform. So that before running the macro that goes to the next control, all of the bar coded data gets inserted into the field.

I tried the if statement suggested, but the len is not calculated until AFTER the first field loses focus to the second field. Len > 8 is not available to be evaluated at the time of the onchange event.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top