Access 2000 - unique identifiers

J

JTS

The business wish to have a unique identifier which is month, year, nnn where
n starts at zero each month and is sequential as each quote comes in until
the end of the month. Whereby the sequential numbers begin at zero again.

For example the 43rd quote this month would have a reference number of
12/09/043

To avoid duplication they wish Access to prompt with the new reference
number when they access the new quote form.

Can this be done?
 
D

Dorian

Put your identifier in a column with a unique index.
Then from the Date and DatePart functions (look in HELP) you get the current
year and month. The you do a DMAX function (look in HELP) on this table to
get the highest current value then add 1 and immediately save the table row
(otherwise someone else may grab the number before you save it).
I don't see how your prompts avoid duplication. Perhaps management never
heard of a 'unique index'.
-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top