Delete & Re-Create an AutoNumber Field

seashton

Registered User.
Local time
Today, 00:31
Joined
Oct 11, 2000
Messages
14
Delete & Re-Create an AutoNumber Field

Is it possible to Delete & then Re-Create an AutoNumber Field using code so it will start numbering with 1 again. I will then use this table in a query to ascertain the the 20th record to post in a report. It works but when I Re-run the query I get a differnet set of "every 20 records". If I reset the autonumber field manually I will get the results identical to the 1st time I ran query. Any suggestions how to accomplish this?
 
Not sure I understand the logic but won't you just return the 20th record every time anyway or are you deleting records?
 
You are correct, the table's records are deleted first and then the query re-runs requiring a new date range criteria be entered and that data is then used in a report. If I enter the same date range again a different set of records are found, but they are still 20 records apart from each other.

I used this in the query to determine every 20th record "Survey20: ([SurveyID]) Mod 20" with the criteria set at "0". SurveyId is the autonumber field of table). Also if I manually delete and then replace the autonumber field in the table I then can then duplicate the records from the previous query ran. This is why I am trying to find a way to automate this with some simple code. Any suggestions for an amateur access user?
 

Users who are viewing this thread

Back
Top Bottom