ID code not autonumber

silver05ram

New member
Local time
Today, 05:35
Joined
Mar 27, 2012
Messages
2
I want to create an (8) digit number such as 20121234 (1st four are the year and the last four digits would be an auto number) how would I go about doing this. I am a new user to Access and I have built my (4) main tables and before I go create my forms sheets ect I want to get my "id" column creating the correct number sequence. Any help would be greatly appreciated!!
Silver05Ram
 
Welcome to the forum.

General wisdom says that you should use the Autonumber function to create your Primary Key (PK).

However you can still create an Order or similar. You can use the DMax() function to increment a counter field.

You can then use the Year() function to extract the year number from the current Date(). You can then pull these various values together for display purpose, on a form or report whenever you like.

Have a look at the attached sample for a demonstration of this. The sample creates an order number the resets each day, for each office. You should be able to addapt this to create the sort of number you are after.
 

Attachments

Thanks man, but if I understand correctly I have to make a form and refference that in the "project id" area? All I really want is the year 4digit and then a 4 digit number (not the date) but a number starting at 0001 and going up, this is going to be used for various fields in my company and I am building to track the plan volume we engineer which will be in the thousands by years end...
 
Yes you will need a form. But then forms are vital to the smooth operation of any DB.

Your tables are only for storing your data, and you user should have no direct access to the tables, all interaction with that data should be through the "filter" of a Form. In this way you can control the data your user sees, how they see it (i.e. it's appearance), and what they are able to do to that data. Without a properly constructed form non of this is possible.
 

Users who are viewing this thread

Back
Top Bottom