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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multi-field index

Status
Not open for further replies.

lmcc007

Technical User
Joined
May 7, 2009
Messages
164
Location
US
I have a tblPhoneNumber table with five fields:

PhoneNumID
PhoneTypeID
PhoneNumber
PhoneExt
CompanyID

I created two indexes using the Indexes button on the Show/Hide ribbon.

PhoneTypeIndex includes: PhoneTypeID and CompanyID. Which works--I can not create the same phone type for a company.

PhoneNumberIndex includes: PhoneNumber and PhoneExt. It does not work. I only want the phone number to be repeated if the phone extension is different.

What am I doing wrong?

Thanks!

 
What am I doing wrong?

You are trying to index non-unique data. Get rid of the duplicates (maybe with some VBA/SQL or a delete query) before they are inserted into the table.

Ever notice how fast Windows runs? Me neither.
 
Ok, duplicate query. Gotcha!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top