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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Use Autonumber to create a long ID for a Barcode

Status
Not open for further replies.

TammyT

Programmer
Sep 17, 2003
183
US
I am creating a table to capture donated items; each item will need a unique ID for tracking - an autonumber, obviously.

I want to take that ID & make it into a barcode number - is there anyway to set the properties of an autonumber to start be 10 digits instead of 1? I only see where I can choose random vs increment.

Thanks!
 
possibly the 'format' property, may suffice?

eg; Format = 000000000 'equals leading zeros
 
How are ya TammyT . . .

Have a look below:

How to Use an Append Query to Set Initial Value of an AutoNumber Field


Calvin.gif
See Ya! . . . . . .
 
Thanks, AceMan! I think that might do it. If not I'll let ya know!

Zion - appreciate the thought - only problem is, there is no format option when you choose autonumber.
 
Bar codes don't need to be 10 digits.

You can use a symbology like I2of5 (Interleaved 2 of 5) that encodes any numeric value in a bar code. It supports even numbers of digits so, if you encode an odd number or digits, the barcode printing software prefixes a zero to the string being encoded.

Here is one of the many hits produced by a Google for "Barcode Symbologies
 
Golom - that would be very useful; however, can I do that & still use the Autonumber option?
 
Sure.

The issue for me is that autonumbers have some quirks of which you should be aware.

- If you begin the creation of a new record or remove (i.e. delete) a record then there will be gaps in the autonumber sequence.

- The usual mantra for autonumbers is that users should never see them because they will then want to change them ... and you can't with autonumbers.

-In connection with bar codes, UPCA for example has an internal structure. That's not something that you can enforce with an autonumber since you don't control it's value.

- Some barcode symbologies use a check-digit (optional with I2of5.) If you want to implement check digits then you will need to create your own numbers because the autonumber doesn't have a check digit.

Much if this hinges on how you will be using the autonumber values. I assume that, since you specified bar-codes, that you intend to attach bar code labels to the donated items. In that case (and living with the limitations of autonumbers such as gaps and no control over the value assigned), this option should take care of your basic requirements.


 
Well, I'd really love to have the option to create a numbering system that includes letters for coding (like CR50415061 for a crib, donated on 4-16-06, & it's the first one that day - that kind of idea; doesn't have to include the donation date, that's just to get more numbers!).

If I don't use autonumber (which is fine), I'm guessing I'll need some kind of VBA on the form that "creates" the barcode based on certain criteria - yes? Do you have that kind of coding info?

Thanks so much for your help!
 
very common is the, "DMax() + 1" routine.
You may decide to have a "hidden" column, in your table,
that holds the value of the most recent entry, for barcode.

From there, you obtain it using DMax(), then increment it
by one, then possibly, add your date().

That sort of idea.

Dmax is valid on dates, integers, a single characters,
as far as accuracy & consistency goes.
Alpha numereic values, may be unpredictable, so you
may need to parse bar code, before Dmaxxing, etc....
strrBarCode = DMax("Right(txtBarCode,1)","tblDonations")
 
Zion7's idea will work but take note that bar code symbologies that support both letters and numbers tend to be LARGE. They take up a lot of space on the label.

It's also not a good idea to build structure into your bar-code labels. You can store far more information about the item in the database than you can in a structured bar code and the barcodes are really intended to uniquely identify the item ... not to describe it. They are also intended to be read by barcode scanners ... not humanoids.

Think of them as the license plate for a car. It doesn't tell you anything about the car other than the fact that no other car has that license number.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top