How do I create a custom autonumber in Access 2003?

P

Pat

I am trying to create a reporting program for our Public Safety Department
and they want the records to be automatically numbered using the format
YYMM-### (Example: first report for the month of Sept. 2006 would be 0609-001
then 0609-002. etc. and then in October 2006 it would be 0610-001).

Is this possible and if so, can you tell me how?
 
K

Ken Snell \(MVP\)

Use two separate fields, one for YYMM value and other for ### value. Make
the two fields a composite primary key so that unique values of the two
fields in combination will be required. You can then handle the
incrementation of the ### field using widely available code that involves
the DMax function.

You then can concatenate the two fields with the - character in queries for
display on forms and reports.
 

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