AutoNumber Input Mask Format

S

Sondra

Me again...

I have created a table that uses an autonumber for the
primary key which will be used in about 90% of my forms,
queries and reports. The format of the autonumber is
000. However I need to create the reports to show a
different format. I want it to look like 03CC-001, 03CC-
002, 03CC-003, etc.

I have entered the format at "03CC-"000; however I will
have to go in and modify everything for next year as "04CC-
"000.

Is there a format I can enter that will automatically put
the year in for me. I have tried entering yy"CC-"000 but
it comes up as 1900CC-001, 1900CC-002, etc. I then tried
y"CC-"000 and still couldn't make the current year work.
Does anyone have any suggestions? This is a big concern
as I create several databases for our region that require
date but also consecutive numbers.

Thanks.
 
J

John Vinson

I have entered the format at "03CC-"000; however I will
have to go in and modify everything for next year as "04CC-
"000.

You're on the WRONG TRACK.

If you change the *format*, then all your 2003 data will be displayed
as 04CC once you change the format. Also, the number will not start
over at 1 on January first!

An Autonumber *IS NOT SUITABLE* for this purpose! Autonumbers always
have gaps, and can become random (for instance if you Replicate your
database); -2045223819 is a perfectly valid autonumber value but won't
fit your mask.

Dates (years) *are data* and should be stored as data; you will need
some VBA code to create and maintain this ID.
 

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