Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unique combinations of two Field 1

Status
Not open for further replies.

Crookshanks

Technical User
May 18, 2004
296
0
0
NL
Goodafternoon,

I've got a table with 5 fields, lets say fields A,B,C,D,E.
The table is filled from different sources (imports, VBA created info etc. etc.).
After the fill (or during) I want that each combination of A and B occurs only one time. What is easiest?

1) Make a query with the DISTINCT command. And work with that. How do I write a DISTINCT on two field?
2) Design the table in a way the two fields make the primairy key. I know it can be done, but I do not know how. Futhermore, I guess I should write some error handling as I am importing using this methode.

Any help appreciated.
Kind regards,
 
yes, the easiest way is to make a composite two-column primary key

open the table in design view, make sure both columns have that little golden key beside them, then save the table

you may have to empty it first, then re-load it later

r937.com | rudy.ca
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top