unique identifiers

Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

Forum home » Delegate support and help forum » Microsoft Access Training and help » Unique identifiers

Unique identifiers

resolvedResolved · Low Priority · Version 2003

Izaskun has attended:
Access Introduction course
Access Intermediate course
Access Advanced course
Access VBA course

Unique identifiers

can we have more than one key field in the same table

RE: unique identifiers

Hello Izaskun ,

Hope you enjoyed your Microsoft Access course with BEST STL Training.
Thank you for your question regarding Unique identifiers.

In situations where you can't guarantee the uniqueness of any single field, you may be able to designate two or more fields as the primary key. The most common situation where this arises is in the table used to relate two other tables in a many-to-many relationship.

For example, an Order Details table can relate the Orders and Products tables. Its primary key consists of two fields: OrderID and ProductID. The Order Details table can list many products and many orders, but each product can only be listed once per order, so combining the OrderID and ProductID fields produces an appropriate primary key.

Each product can be listed only once per order.

Another example would be an inventory database that uses a field part number of two or more fields (part and subpart).

If you are in doubt about whether you can select an appropriate combination of fields for a multiple-field primary key, you should probably add an AutoNumber field and designate it as the primary key instead. For example, combining FirstName and LastName fields to produce a primary key is not a good choice, since you may eventually encounter duplication in the combination of these two fields.

In a multiple-field primary key, field order may be important to you. The fields in a multiple-field primary key are sorted according to their order in table Design view. You can change the order of the primary key fields in the Indexes window.

I hope this resolves your question. If it has, please mark this question as resolved.

If you require further assistance, please reply to this post.
Or perhaps you have another Microsoft Office question?

Have a great day.
Regards,

Richard
Microsoft Office Specialist Trainer


 

Access tip:

Compact database automoatically

To ensure optimal performance, you should compact and repair your

Open the Access database or Access project that you want Access to compact automatically.
On the Tools menu, click Options.
Click the General tab.
Select the Compact on Close check box.

View all Access hints and tips


Server loaded in 0.09 secs.