Question

Locked

Auto Assign a Unique ID in MS Access

By h_macmullin ·
When a record is first added to this particular database I?m working on, I would like a record to be automatically assigned the current date (e.g. 22-Jul-09) in a separate field. I also would like to be able to automatically assign each record with a unique alphanumeric identifier (e.g. KARL090722) when a record is first created. The first 4 alpha characters are pre-defined in a field of their own and ideally, the 6-digit numeric part is a date identifier as to when the record was created.

I would appreciate any suggestions as to how to go about accomplishing this. I would also settle for some alternative in automatically assigning some kind of unique alphanumeric identifier.

Thanks for the help.

This conversation is currently closed to new comments.

1 total post (Page 1 of 1)  
Thread display: Collapse - | Expand +

All Answers

Collapse -

Well the date one is simply setting default

by Tony Hopkinson In reply to Auto Assign a Unique ID i ...

of Today() ,GetDate(), Now() ???
How can that identifier be considered unique, what stops you adding two KARL's in one day?

Personally I'd just add an identity column if there's no other key and then when I needed the 'UniqueID', just Query it out with a select statement, intelligent identifiers usually turn out to be real dumb in my experience.

Can't see anyway of doing waht you describe except in code through say a form with a BeforePost event handler or some such.

Back to Software Forum
1 total post (Page 1 of 1)  

Related Discussions

Related Forums