Combining fields to create a unique ID in Microsoft Access

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

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.

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

Processing your response...

Discuss This Question: 1 &nbspReply

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

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

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

Processing your reply...

Ask a Question

Free Guide: Managing storage for virtual environments

Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!

To follow this tag...

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