Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unique Record ID in Access 2003

Status
Not open for further replies.

wannabe2007

Technical User
Jul 22, 2009
5
0
0
CA
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.
 
How is your data being added to the table? Via a Form? If so, you can use VBA to do whatever particular combination(s) you want.

So, where does KARL come from? If it's based on some other field(s), you can grab that piece in VBA, and then grab whatever else for the numbers and put the two together either in a form field which feeds to your table, or else directly into your table.

Post back and let us know more detail.

--

"If to err is human, then I must be some kind of human!" -Me
 
Yes, the data will be entered via a form. KARL is an example of a predefined unique field assigned to each record of the database.

Can you suggest where I might find some sample VBA coding that would enable me to do what you’ve suggested? Thanks so much for your help.
 
The help files are actually filled with good examples (the VBA editor help files specifically).

Otherwise, you can ask for specifics on here in the Access VBA forum:
forum705

And Google is always a good source. [wink]

--

"If to err is human, then I must be some kind of human!" -Me
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top