Automatic Quantity, and Input After Every Barcode Scan

conton

New Member
Joined
May 25, 2011
Messages
15
Hello!

I have a database that keeps track of customer orders of one product. I have an order form that has many fields, the two pertinent to this question being the Quantity and the Barcode field. I use a scanner to input the barcodes. At the moment, I manually input the amount of product I am scanning for the order in the Quantity field, and put a comma and a space after each barcode I scan into the Barcode field.

Here is what I would like to accomplish:
  1. For Access to automatically input the comma and space after each scanned barcode in the Barcode field. I don't know what input my scanner produces, but I assume it is simply a keyboard emulator. So, I imagine the only way to accomplish this would be to have the Barcode field insert a comma and a space after every 9 characters entered (ie. barcode format XX-XXXXXX).
  2. For Access to automatically count the amount of barcodes I have scanned into the Barcode field and store that amount in the Quantity field. The only way I can think to do this is to have the Quantity field count the amount of characters in the Barcode field, and produce the amount based on that. So, for the Quantity field to count 1 for every 11 characters in the Barcode field (ie. 9 barcode characters, a comma character, and a space character).
So, in short, I would like to simply scan the barcodes, and not have to manually input the comma and space after each barcode, or the quantity of barcodes I have scanned.

Thanks in advance!
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
You should be adding a record for EACH barcode. It should be a junction table which lets you add as many as you need. They should not be added on in the same field. That violates the rules of normalization and makes getting the data back out hard as hell.
 
Upvote 0
You should be adding a record for EACH barcode. It should be a junction table which lets you add as many as you need. They should not be added on in the same field. That violates the rules of normalization and makes getting the data back out hard as hell.

Actually, in my old system, I had five separate fields for five unique barcodes. The obvious problem there was that, if there were more than five units ordered, I couldn't store all of the barcodes. That is why i am trying to edit that old system to allow me to scan unlimited barcodes for each order.I am not familiar with junction tables, but it sounds like what I need. I will play around with a junction table conversion.

In that case, I would need a different solution for my quantity problem as well.

Thanks for the advice!
 
Upvote 0
If you have the junction table you can have a field for the barcode, the ProductID and the quantity. If it is a subform on the products form, then the productID can be filled in automatically by Access. Then you should be able to enter quantity, hit the enter key and have the after update event of the text box move you to the barcode text box and then you can scan and in it's after update event you could move to a new record.
 
Upvote 0
Hi there! How do I go about making the after update event of the barcode move to a new record?
 
Upvote 0
In the After Update event you would put:

Code:
DoCmd.RunCommand acCmdRecordsGoToNew

I put that code in the barcode text box's AfterUpdate routine, and it doesn't appear to be moving to the next record. It just moves to the next text box.

When is the afterupdate routine triggered? For instance, if I were to input the barcode manually and hit enter, would that trigger the AfterUpdate code?
 
Upvote 0
If you put it in manually and hit enter, yes it would trigger. But the after update event won't fire if the value is updated via code. In that case you need to call it explicitly.
 
Upvote 0

Forum statistics

Threads
1,224,587
Messages
6,179,740
Members
452,940
Latest member
Lawrenceiow

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top