By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,300 Members | 2,044 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,300 IT Pros & Developers. It's quick & easy.

preventing duplicate record entry

P: n/a
I have a form, pulling data from a Products table that has many fields
that do lookups to other tables. These are in a one-to-many
relationship to a pk in each of said tables.

I'd like to be able to compare the data on a BeforeUpdate event to be
sure that this data is not duplicated.

Here is the structure:

Products 8-1 Frames
8-1 Color
8-1 Size
8-1 Branch

What I'd like to do:

Sudo-code: If Frames.FrameID AND Color.ColorID AND Size.SizeID AND
Branch.BranchID
Are found in any other recordset THEN
MsgBox "Duplicate Record"
Exit Sub
End If

There are only about 4k records so far in the products table, but I'm
not sure if this will get slower doing it in code as data grows, and
I'm no SQL coder...

Thanks in advance.

Sep 11 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On 11 Sep 2006 05:44:26 -0700, pc****@gmail.com wrote:

Why not put a unique index over these 4 fields?
-Tom.

>I have a form, pulling data from a Products table that has many fields
that do lookups to other tables. These are in a one-to-many
relationship to a pk in each of said tables.

I'd like to be able to compare the data on a BeforeUpdate event to be
sure that this data is not duplicated.

Here is the structure:

Products 8-1 Frames
8-1 Color
8-1 Size
8-1 Branch

What I'd like to do:

Sudo-code: If Frames.FrameID AND Color.ColorID AND Size.SizeID AND
Branch.BranchID
Are found in any other recordset THEN
MsgBox "Duplicate Record"
Exit Sub
End If

There are only about 4k records so far in the products table, but I'm
not sure if this will get slower doing it in code as data grows, and
I'm no SQL coder...

Thanks in advance.
Sep 11 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.