By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,968 Members | 1,178 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,968 IT Pros & Developers. It's quick & easy.

Combo box and barcode scanning

100+
P: 121
Hi,

I have a form with a number of combo box's the first combo box contains a barcode that is associated with user information then the next box contains a barcode that is associated with task information and so on...

Basically what i need to do is scan the barcode and once the barcode is scanned automatically jump to the next combo box ready for the next barcode scan.

I am trying to avoid the user having to press any keys to input data into the combo box's and just scan the barcode...

I have tried the following code on the afterupdate and beforeupdate event with no success


Expand|Select|Wrap|Line Numbers
  1. Me.cbotaskid.setfocus
which works fine if you "manually" select the record but it does not automatically move to the next combo box if you use the scanner

Please Help

Regards Phill
May 5 '09 #1
Share this Question
Share on Google+
7 Replies


Expert 100+
P: 1,287
The AfterUpdate and BeforeUpdate events are triggered, usually, when the focus moves out of the field. For the behavior you want, you might use the Change event. Within the event code you can check if a full barcode has been entered, and if so, move to the next box.
Expand|Select|Wrap|Line Numbers
  1. If Len(firstComboBox.text) = lengthOfABarCode Then
  2.   secondComboBox.SetFocus
  3. End If
Hopefully, I am correct in assuming that scanning a barcode emulates typing a series of numbers into the fields. I don't know anything about bar codes, so disregard this if I'm completely off.

Good luck,
Chip
May 5 '09 #2

Denburt
Expert 100+
P: 1,356
I have worked with Scanners in the past and most have a setting that users can change so that once a barcode is scanned it will send an "Enter" or a "Return" I believe that some will even output a "Tab" this can easily be used to move to the next field. If your scanner doesn't have this option then you could fall back on to Chips idea as that would be your best option.
May 5 '09 #3

JustJim
Expert 100+
P: 407
By coincidence, I am currently working on barcode implementation for a client. Are you creating your own barcode labels? What barcode system and what barcode font are you using? Do you use Access to produce the labels as well?

It is perfectly reasonable to build one bar code that encodes "UserInformation"TAB"TaskInformation"ENTER" all at once.

Jim
May 5 '09 #4

100+
P: 121
Hi ChipR

thanks for the reply I tried your code but now I am getting the error

Run-time error 2110 "Can't move the focus to....

Any ideas?

Hi Just Jim no im not using access to create the barcodes at this stage the barcode font i am using is Free 3 of 9 Extended

Any help is much appreciated

Regards Phill
May 8 '09 #5

Expert 100+
P: 1,287
It seems like this will happen if the value of the control isn't valid when you try to change the focus.
May 11 '09 #6

100+
P: 260
I like the IDAutomation font. It's a free download. It has provided better barcodes than the Free 3 of 9 font. You can print your barcodes in Access by simply making a control on the form and changing the font to your barcode font. Keep in mind most barcodes have to have an asterick * before and after them. So in the control you might need this: ="*" & [YourFieldName] & "*"
Apr 22 '10 #7

Plater
Expert 5K+
P: 7,872
We solved a similar problem by programming the barcode reader to append a newline(you could use any special character probably) and based on that we knew when to jump locations
Apr 22 '10 #8

Post your reply

Sign in to post your reply or Sign up for a free account.