Create autonumber

H

Harmannus

Hallo,

I have a invoice table with an autonumberID.

How can i add the fields "ordernumber" and "invoicenumber" as a autonumber?
Access only alows one autonumber to be present in a table.

And how do i make my own autonumber starting from a e.g. 2003001

Thanx for any tips!

Regards,

Harmannus
 
J

Jeff Boyce

Harmannus

An Access Autonumber data type is designed to serve as a unique row
identifier. It's generally unfit for human consumption.

If you need a ID number (or two, or three), consider creating your own -- a
check at Google.com for "custom autonumber" will reveal some leads.

The generic concept is to set the new ID equal to one greater than the
largest existing value (something like DMax([YourIDField]) + 1 ).

By the way, if you want to keep information about the year and a "sequence"
number (that's why you want "2003001", right?), do so as two separate
fields -- embedding more than one fact in a field, and use of "smart" keys
(a pejorative) is frowned on in relational database design.

Good luck!

Jeff Boyce
<Access MVP>
 
T

TC

I think you will find that your table structure is wrongly designed. What
are the fields of the table in question? What do you say is the primary key
of that table?

TC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top