I don't really know much code, so I have no idea where to begin.
I have a table (DocTable) for library documents: title, year, document ID number (just an autonumber) and file number. The file number field is what I need help with. I need the documents numbered in the order that they will be entered into the database, but separated by year, so that for each year the numbering restarts at 1.
Because I can't figure out how to do this, I have a separate FileNo field for each year: FileNo1990, FileNo1991, etc. I'd really like to have only one field, if possible.
I tried this code for each year, but since I don't really know what I'm doing, I don't know where I went wrong:
UPDATE DocTable
SET FileNo1990 = FileNo1990 + 1
WHERE Year = 1990
If someone could show me the proper code, it would be greatly appreciated.
Thanks!
Rachel
I have a table (DocTable) for library documents: title, year, document ID number (just an autonumber) and file number. The file number field is what I need help with. I need the documents numbered in the order that they will be entered into the database, but separated by year, so that for each year the numbering restarts at 1.
Because I can't figure out how to do this, I have a separate FileNo field for each year: FileNo1990, FileNo1991, etc. I'd really like to have only one field, if possible.
I tried this code for each year, but since I don't really know what I'm doing, I don't know where I went wrong:
UPDATE DocTable
SET FileNo1990 = FileNo1990 + 1
WHERE Year = 1990
If someone could show me the proper code, it would be greatly appreciated.
Thanks!
Rachel