Primary Key

emcf

Member
Local time
Today, 12:34
Joined
Nov 14, 2002
Messages
209
I was on an access course recently and the tutor did mention how to do this but, alas, i did not document his response! What I am trying to do is to create a primary key as an autonumber but have it in the format "2003/001" etc. :confused:
 
It is generally not a good idea to have a primary key as a composite string (Search here for articles by Pat Hartman)
Keep your primary key as simple as possible eg an autonumber but then have an additional indexed field for your own key.
 
You can format a primary key to look that way for display purposes:

Year(SomeDateField) & "/" & Format(YourAutonumberField,"000") As FormattedKeyField
 

Users who are viewing this thread

Back
Top Bottom