There's nothing in Access to stop you from using a date as a primary key. Personally, I wouldn't do it because it's a bit sloppy, but you can if you want. Just be careful because different computers might be set to different regional date formats. Take 4/5/08 for example. You might see this as April 5th. Someone in Europe would see May 4th. If I were to use a date as a key field, I would make a custom format like this: YYYYMMDDHHNNSS. That way my date is accurate down to the second, and this format is nearly universal. The only problem you have then is what if two records are added by users on a network at the exact same moment? Will Access handle it? I'd be curious to see (no, I'm not going to set it up and test it right now). You could also run into problems around Daylight Savings Time switchover... all of the sudden it's 1:00 AM again and you're running into tons of duplicate values! I personally prefer and recommend using AutoNumbers for primary keys. That's basically what they're in Access for.
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Access Beginner 3.