Shooter54
asked on
How can I create a field in a table using a make table query which increments?
I have a make table query that i would like to create a field, not to be populated by the results of my query, but rather to start with 1, and increment by 1 for each successive record. Can someone point me in the right direction?
I'd suggest you do it as an append query, after first creating a table with an autonumber field + the columns in your query. The query appends to every field other than the autonumber field.
ASKER
I've tried that method. I created the table, appended records to it, and the first time it autonumbered correctly beginning with the number "1". Then I ran a delete query that deleted the records, preparing it for the next time I need to do the same thing, however the autonumber field doesn't begin numbering at "1" during subsequent appends, rather beginning at the next number that was available prior to running my delete query. I suppose there is a brilliant way to do this using code, however I'm not the greatest programmer using VBA.
For starters, autonumbers are simply a means to creating a unique identifier. No meaning should be assigned to them. If you want to have a number that you can control, use DMax() to assign a sequence number.
If you insist on using an autonumber, you can force it to reset by resetting its Seed. I've attached the text of a KB article explaining how to do it.
Reseed.docx
If you insist on using an autonumber, you can force it to reset by resetting its Seed. I've attached the text of a KB article explaining how to do it.
Reseed.docx
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.