473,387 Members | 1,476 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

preventing duplicate record entry

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
1 1987
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Drew | last post by:
I have a permission tracking app that I am working on, and I have made the insert page for it. I am having issues on how to prevent duplicates from getting entered. Currently the interface for...
3
by: ColinWard | last post by:
I am using the following code to validate that the person that is being entered into the database does not already exist. However wnem I test it by entering myself as a contact(I first checked that...
5
by: Darrel | last post by:
I have a web form that inserts a record into a DB. This function is called from the button_click subroutine. After the record is inserted, I show/hide some different panels and let the page...
5
by: Manish | last post by:
The topic is related to MySQL database. Suppose a table "address" contains the following records ------------------------------------------------------- | name | address | phone |...
8
by: Iona | last post by:
Hi Allan, I'm using a nifty piece of code you put on here some time back to do a duplicate entry check as below. I'm using to check for duplicate names. However I am getting an error message on...
0
by: claus | last post by:
Hi, I am not a programmer but tries anyway to program a feature in a form where I am able to copy entries for the form and a subform. I have tried follow the guide here...
5
by: baur79 | last post by:
Hi guys i try to run this code in loop and to pass even the entry is duplicated def email_insert_in_db(email): sql="INSERT INTO emails (email) values ('%s') "%(email)...
6
by: teser3 | last post by:
I have my PHP inserting into Oracle 9i. But how do I prevent duplicate record entries? I only have 3 fields in the insert in the action page: CODE <?php $c=OCILogon("scott", "tiger",...
9
by: rjshrader | last post by:
I have a table (tblStatus) with three fields (CustomerID, StatusType and StatusDate). I use an unbound form with three text boxes to enter data into the table when a command button (cmdSave) is...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.