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

Auto Numbering

Status
Not open for further replies.

jbento

Technical User
Jul 20, 2001
573
US
I have a database that I saved off as an .mde executable. One of the fields is an Autonumber field.

That database is for other users to use, and when I create a new version of it, I have take the table and import it into the new version.

When this is done, it changes the autonumbers to different numbers. It doesn't keep the previous autonumbers that was assigned.

How do I prevent this from happening?

Jerome Benton
JERPAT Web Designs
GOD Is Good All The Time!!!
 
One method that you could do is to create a table (call it autonumber) and have one field that is used as your 'auto number'. Every time you need a number you go to this field take the number, increment it by one and update the field. I use a stored procedure that updates it automatically. This is often used for invoice and order numbers.

The data type for the fields that will receive this 'auto number' will be integer.

This will prevent another database from resetting your imported autonumber values.



Thanks and Good Luck!

zemp
 
It shouldn't really matter that the autonumbers change (unless of course it's playing havoc with the relationships)

?

Transcend
[gorgeous]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top