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

Detecting which Index is causing Err3022 (Duplicate values in Index)

Status
Not open for further replies.

apkohn

Technical User
Joined
Nov 27, 2000
Messages
62
Location
AU
I have a table that has a number of fields, that are Indexes with No duplicates permitted.

Programatically adding data to the table in VBA, there is a slight chance that the Word Doc that a user sets up to import the data may have duplicates.

Now, for each field, I can overrule what the user has enterred to maintain no duplicates (ie if a duplicate is detected replace with a new value).

Given that there are multiple indexes in the table, is it possible to detect which index is causing the problem that raises the 3022 error (The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again.)

If it is, I would then be able to attempt the user's data, detect the error and then update the problem value. As it stands now, I have to do a Dlookup on each value, before adding it to the table. For the number of rows I have, and the low likelihood of having this problem, I would rather not have to do so many checks.

So, in summary, is there any way to identify which index causes the problem for a 3022 error?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top