i am using the following code to generate a number in a text box on a form when data is entered into the form:
what i would like to know is, is there any way that when the new year comes the number will restart at 0001. i do have a year field in my table as it is the first part of our unique ticket number system.. the number would display as
"09-0001" with "09-" being the default value for the year field that i will change every year. hope thats enough info to make sense... any help is greatly appreciated. thanks!
Code:
Private Sub Form_BeforeInsert(Cancel As Integer) Me![TICKETNUM] = Format(Nz(DMax("[ticketnum]", "master"), 0) + 1, "0000") End Sub
"09-0001" with "09-" being the default value for the year field that i will change every year. hope thats enough info to make sense... any help is greatly appreciated. thanks!
Comment