How to Intilize Auto Number Field

  • Thread starter Thread starter NewsGroup
  • Start date Start date
N

NewsGroup

Dear Friends,

I am the new in this group, I have a problem that how to intilize the auto
number fields, If I want to restart auto number from 1, what i do ?

Please reply

Thanks

Waseem
 
The AutoNumber starts from 1 by default.

If you have already had data in the table and deleted it, compact the
database to reset the seed:
Tools | Database Utilities | Compact/Repair
or in Access 2007:
Office Button | Manage | Compact/Repair

To programmatically set the Seed to a higher number, see:
http://allenbrowne.com/ser-26.html
http://allenbrowne.com/func-ADOX.html#ResetSeed

To programmatically delete the data and reset the seed:
http://allenbrowne.com/func-ADOX.html#DeleteAllAndResetAutoNum
 
Compact and repair on the MDB where the table is located in will intilize the
auto number back to 1. but that if there are no records in that table.
 

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

Back
Top