Quote:
quote:Originally posted by semooth
Can anyone please tell me how to generate an autonumber back to 1 for each beginning of the month.
|
Actually, you would never do that. You see, an autonumber's purpose is simply to identify the record and match it up with other records pertaining to it contained in other tables. It would be the key field in the table.
If you have a field that needs to be reset to 1 each month, then this field would not be an autonumber field. It would be simply a case number or transaction number, etc. You would increment this number by one for each added record, but the other field with the autonumber would just keep going higher and higher.
The case number or transaction number (the one that's reset to 1 each month) would be visible to the user, but the autonumber (that's never reset) is never seen by anyone. Again, it's simply used to tie data from one record in one table to another record (or records) in another table.
Example Table:
Code:
Day of Month AutoNumber (Rec No) Transaction No.
1 1 1
2 2 2
3 3 3
1 4 1
2 5 2
3 6 3
1 7 1
2 8 2
etc.
The autonumber is simply used to match Record 7, for example, to Record 7 in another table. This number will never be seen by anyone. The computer uses it, not the user. The only number you care about the one you reset every month (transaction number).
That's why Microsoft Access made the autonumber "un-resetable."
Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division