Temporarily switch off records autonumbering, then restore records autonumbering.

J

Joe M

Hi,
I have a table with the autonumber field. I need to override the
autonumber field and enter some old values. How do I temporarily switch off
the autonumber field for these values. Then restore the autonumbering
functionality after these records are written?? What I need is temporarily
switch off records autonumbering for some values, then restore the record
autonumbering after these values are written. Thanks
 
D

Douglas J. Steele

You can't change an autonumber type.

To do what you're trying to do, create a second table that's identical to
your existing table except that it just has a Long Integer field rather than
the Autonumber field. Populate that second table, putting in the desired
numbers in the Long Integer field. Create an Append query (INSERT INTO...)
that takes the values from the second table and puts them into the original
table.
 
J

Joe M

Thanks Douglas, can you please give me the coding examples of APPEND/INSERT
records from the second table to the original tables. Thanks.
 
J

John Vinson

Thanks Douglas, can you please give me the coding examples of APPEND/INSERT
records from the second table to the original tables. Thanks.

No "coding" involved. Simply create a query based on the second table;
use the Query menu option to change it to an Append query. Name the
first table when asked what you want to append to.

John W. Vinson[MVP]
 

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