kengooch
Member
- Local time
- Today, 01:40
- Joined
- Feb 29, 2012
- Messages
- 137
I have a database that has a separate index ID so that each Accession has a unique number.
I need to track the Accession numbers by the Prefix "S" and then the last two digits of the year ie 2019 would be "S19".
So the system tracks Accession numbers by the Year "S19" and then in a numeric sequence from 0001 to 9999. It is mandatory that the leading zeros appear. So the number would be S19-0001, S19-0002 etc.
I created a field called tAccYr and set the default value as
"S" & Right(Year(Date()),2)
I then created a field Called tAccNum that needs to begin with 0001 and increment by one for each new Accessioned item.
When the year changes, in field tAccYr the field tAccNum needs to restart at 0001 again.
I was thinking that I could us DMax or DLast to get the previous number in the Default Value Field Property of the tAccNum field. But I can't seem to make it work, much less tell it how to restart at 0001 if tAccYr changes to the next year.
Would appreciate very much some help with this.
I need to track the Accession numbers by the Prefix "S" and then the last two digits of the year ie 2019 would be "S19".
So the system tracks Accession numbers by the Year "S19" and then in a numeric sequence from 0001 to 9999. It is mandatory that the leading zeros appear. So the number would be S19-0001, S19-0002 etc.
I created a field called tAccYr and set the default value as
"S" & Right(Year(Date()),2)
I then created a field Called tAccNum that needs to begin with 0001 and increment by one for each new Accessioned item.
When the year changes, in field tAccYr the field tAccNum needs to restart at 0001 again.
I was thinking that I could us DMax or DLast to get the previous number in the Default Value Field Property of the tAccNum field. But I can't seem to make it work, much less tell it how to restart at 0001 if tAccYr changes to the next year.
Would appreciate very much some help with this.
Last edited: