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
Allen Browne - 14 Mar 2007 11:33 GMT
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

Signature
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
> 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 ?
Ofer Cohen - 14 Mar 2007 11:38 GMT
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.

Signature
Good Luck
BS"D
> Dear Friends,
>
[quoted text clipped - 6 lines]
>
> Waseem