Unique Records (1 Viewer)

k209310

Registered User.
Local time
Today, 02:31
Joined
Aug 14, 2002
Messages
185
Hello

Is there a way to determine if a enitre record in a table is unique rather that the individual field of a table?

I need to prevent records from being entered if certain records are the same as previose records. IE i need to allow an entry where field1 and field2 are unique but in their own right field one and two can be duplicates.

Any advice is greatly recieved

Chris
 

dcx693

Registered User.
Local time
Yesterday, 21:31
Joined
Apr 30, 2003
Messages
3,265
Easy. Use a multi-field primary key. Look under the Access online help about designating more than one field as part of your primary key.
 

Mile-O

Back once again...
Local time
Today, 02:31
Joined
Dec 10, 2002
Messages
11,316
Can't you make Field1 and Field2 a composite key?

i.e. both part of a primary key
 

Kevin_S

Registered User.
Local time
Yesterday, 21:31
Joined
Apr 3, 2002
Messages
635
Open the table where you want the compound primary key. Clear the current primary key if you have one already selected. Now use the shift button and select both fields that you want to build the key from. Once both fields are highlighted click the primary key button to assign them both as primary keys. If you've done this correctly both fields in the tables design view should have the primary key symbol associated with them.

Thats all there is to it! Now you can have repeating values in either field seperately but only one instance of a combination of the two fields....

HTH,
Kevin
 

k209310

Registered User.
Local time
Today, 02:31
Joined
Aug 14, 2002
Messages
185
Thanks everyone got that sorted i knew you could select many primary keys in one table but hadnt realised exactly what it did. Now i do

Cheers

Chris
 

Users who are viewing this thread

Top Bottom