Primary Key

  • Thread starter Thread starter taitus
  • Start date Start date
T

taitus

Guest
I'm having difficulty in trying to get my primary key to adhere to the following, simple, rule: I just want it to be represented as 4 digits eg 0001, 1234 etc. I've tried entering 9999 as the input mask but it doesn't appear to be right to my novice eye. Anybody help?
 
I don't have an answer but a bit of advice. Just use an autonumber for your primary key field. This field should not have any meaning other than being unique. If you still want the 4 digit code then use a seperate field.

My two cents.

Dwigth
 
Why do you want to do this? I'd follow Dwight's suggestion and use an autonumber. You can then format that autonumber to look like it has leading zeroes and a total of four digits using this formula in a query or form control:
Format([yourfield],"0000")
 
Thanks for the replies - I have managed to sort the problem out (I think) - the system just wanted me to adopt the 4 digit format which I have achieved by using the input mask 9999 - at least that's my understanding of the instructions I've been given. Seems to work fine but I'll bear your suggestions in mind should I be wrong.

Tks
 

Users who are viewing this thread

Back
Top Bottom