G
Guest
Basically I need to calculate a unique number to store in a Microsoft
Accessdatabase which is auto generated when I enter a new record. The number
should be in this format xxxx-001 (the first part reflecting the current
year) and the second part being sequential (with 001 being the first record
of the year)
I thought it could be done by I creating a recordset that retrieves all the
records for the current year then counting to determine the next number which
is also another recordset. If the year is the same, then I'd count the
number of digits and append zeroes to make the value a certain length and
then add the year in. But, if the year is new and there are no records based
on the count, then I'd start the count at 001. PLUS - I'd like this number
to autogenerate when I save the new record - possible put it behind a button
object. But I haven't been able to get it to work.
Accessdatabase which is auto generated when I enter a new record. The number
should be in this format xxxx-001 (the first part reflecting the current
year) and the second part being sequential (with 001 being the first record
of the year)
I thought it could be done by I creating a recordset that retrieves all the
records for the current year then counting to determine the next number which
is also another recordset. If the year is the same, then I'd count the
number of digits and append zeroes to make the value a certain length and
then add the year in. But, if the year is new and there are no records based
on the count, then I'd start the count at 001. PLUS - I'd like this number
to autogenerate when I save the new record - possible put it behind a button
object. But I haven't been able to get it to work.