How do I reset a number field that counts records back to zero?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using Access 2003 and am using a database from the previous year. I
need to reset the number field, that counts the records and gives each record
a unique number, back to zero for this year.
 
I am using Access 2003 and am using a database from the previous year. I
need to reset the number field, that counts the records and gives each record
a unique number, back to zero for this year.

It sounds like you're referring to an Autonumber field. If so you have
some problems!

An Autonumber field has ONE PURPOSE ONLY: it provides an (almost,
barring Access bugs) guaranteed unique key. It does NOT "count
records"; if you delete a record, or even if you hit the <Esc> key
while adding a record, that record's Autonumber will be discarded and
never reused.

Secondly, an Autonumber *is unique* in the Table. If you already have
a 1 in the table for 2004, then the value 1 can never be reused, in
2005 or any other year.

If you want to count records - *then count records*, using a Totals
query. Don't store the count in a table, since if you add or delete
records, *it will immediately be WRONG*.

If you mean that you have a Number field - an Integer or Long Integer
- then you simply need to edit whatever VBA code or Query is assigning
the new values. Do you have such code? If so, please post the code and
someone should be able to help modify it.


John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
Back
Top