Duplicate data SOS.

G

Guest

Hi,

I have a database and I want to get rid of duplication based on criteria
using the duplicate query. In other words, I want to add codes in the
duplicate query so that I can specify my duplicate query. I want the result
of my query to look for two primary fields. Part number and Country. I only
want my duplicate result to tell me how many duplicate I have for part number
and country. Because that is the only unique thing about my database that i
only have one part number for a product registered in each country only but
my other data like the description of the product can be the same and the
expiration of my product can be the same so the only unique thing is part
number and country. Can someone give me ideas what type of code I can use to
help me with the duplication query? Thanks a lot. It will really help save
me a lot of pain going throught all the database.
 
J

John Vinson

The duplicate query and creating a new table I know how to do that. But I
have to do this once in a while or every so often because I have multiple
users but is there a way to prevent the data from added to the table in the
first place when the user is typing the data in my form? So when my user
insert the data in my form if the part # and country match what's already in
the database it will not allow the data to be inputted into the table. I
would love to know if that is possible...so prevention of duplication is what
I would like to know. Thanks so much.

If you want to ABSOLUTELY prevent duplicates on the combination of
Part Number and Country, you can open the table in design view;
ctrl-click the two fields so they're both highlighted; and click the
Primary Key icon.

Or, if the table already has a primary key, use the Indexes tool
(looks like lightning hitting a datasheet) to create a unique
two-field Index on these two fields. Enter an index name in the left
column of the index tool, and select the two fieldnames in that row
and the next row of the right column; specify that the index is
Unique.

This will give the user an error message if they attempt to enter a
duplicate.

John W. Vinson[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top