Combining fields to create a unique ID in Microsoft Access

15 pts.
Tags:
Microsoft Access
Microsoft Access Unique ID
I have been working on a database for my research job.For our research purposes we are trying to create a unique identifier that tells us 4 things: 1) what study they are a part of, [this will be “QQQ” for EVERYONE] 2) what group they are in, [this will be a four digit number, such as 2222] 3) what they’re relationship is within that group, [this will be two digit number starting at 01, 02, 03, etc. ß text field so it doesn’t drop the leading 0], and 4) a random number (so we can distinguish individuals who have identical info for all of the above fields) [single or double digit number] All of this information is available in separate fields already established in the database. However, I would like to create ONE field that combines them all together as one string. For example, their new identifier that encompasses all of this information will read: “RRR-2222-01-1” (with or without the dashes) Is there a way I can do this? I am working in Access 2003 and am fairly new to the database world.

Answer Wiki

Thanks. We'll let you know when a new response is added.

Hi,

I would create a new text field for your unique ID number. Then use an update query to update this field. Put into the Update To row the following: [Field1] & “-” & [Field2] & “-” & [Field3] & “-” & [Field4]. For a random number to be the last field used, I would create an autonumber field. I hope this helps.

Dustin

Instead of creating a random number use the key for the record as the fourth field.

Dick P

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • FSUResA
    It did help. I actually created the combination with the expression builder in a query using the "&" to join the fields.
    15 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following