Quick Access Q

Capodecina
Permabanned
Joined
31 Dec 2003
Posts
5,172
Location
Barrow-In-Furness
It's been a bit since i've used this so i'm looking for some help..

If i've got a table along the lines of...

ID - PK
Name
Building

But I need to make sure that Name and Building are unique, so you can have the same name but for different buildings, but not the same name for the same building.

In SQL I would just have Name and Building set as unique Index keys, does this work the same in Access?
 
Yes you can do this in Access. Just click the index button in the toolbar (or you can use View->Indexes) whilst you are in the design view for the table. In the index form that comes up you can create a new index and add the two fields to it and set the index as unique. The only slightly confusing thing about it is the index form itself. When creating an index that uses multiple fields put an index name in for the first field in the index and the leave the index name blank for the other fields in the index. Just keep listing out the fields in the second column.

Sorry, poorly explained but I hope it helps!!
 
Thanks Fez, just wanted to make sure it worked the same (and like you said the indexes form is a little odd).

Cheers!
 
Back
Top Bottom