473,503 Members | 2,157 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Check For Duplicate

Say a record has 15 fields. Is there a better way to check for a duplicate
when entering a new record than fourteen "Ands" in the where clause of
DCount or FindFirst?

Thanks,

Jerry
Nov 13 '05 #1
5 2119
Umm... set the Allow Duplicates flag in the table to No, maybe, and
then set an PK index on all 15 fields. (whoa, that's ugly.)

Nov 13 '05 #2
Don't think that'll work. Access only allows 10 fields in an index.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

<pi********@hotmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
Umm... set the Allow Duplicates flag in the table to No, maybe, and
then set an PK index on all 15 fields. (whoa, that's ugly.)

Nov 13 '05 #3

Douglas J. Steele wrote:
Don't think that'll work. Access only allows 10 fields in an index.


Didn't think so... wow, that sounds like an ugly solution...

Nov 13 '05 #4
"Jerry" <js*****@nospam.please> wrote in
news:xA***************@newsread2.news.atl.earthlin k.net:
Say a record has 15 fields. Is there a better way to check for a
duplicate when entering a new record than fourteen "Ands" in the
where clause of DCount or FindFirst?


Are all 15 fields required? If not, then the index you need for
determining duplicates is actually smaller, since only the required
fields should be used for determining duplicates (Nulls can't occur
in unique indexes and still guarantee uniqueness).

I for one have never had a table where 15 fields were required for
determining uniqueness -- a natural key with that many fields
suggests a severely denormalized table structure to me.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #5
David,

Thanks for your wisdom!

<<only the required fields should be used for determining duplicates>>
That sure makes sense.

Jerry
"David W. Fenton" <dX********@bway.net.invalid> wrote in message
news:Xn**********************************@24.168.1 28.86...
"Jerry" <js*****@nospam.please> wrote in
news:xA***************@newsread2.news.atl.earthlin k.net:
Say a record has 15 fields. Is there a better way to check for a
duplicate when entering a new record than fourteen "Ands" in the
where clause of DCount or FindFirst?


Are all 15 fields required? If not, then the index you need for
determining duplicates is actually smaller, since only the required
fields should be used for determining duplicates (Nulls can't occur
in unique indexes and still guarantee uniqueness).

I for one have never had a table where 15 fields were required for
determining uniqueness -- a natural key with that many fields
suggests a severely denormalized table structure to me.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc

Nov 13 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
1824
by: Mr. B | last post by:
The following code is how I check for duplicates in a List box. This is simple enough as there is only one column of stuff to check. ' Check for Duplicates ' Search listbox (from last to first)...
1
2043
by: EC | last post by:
I get an SqlException caused by trying to insert a duplicate key into a table. The user needs to be informed and asked to supply a new input. I check the SqlException object and see these two...
2
2513
by: Mike N. | last post by:
Hello again.. I have a table with a text field named "Requisition" (Indexed, no dupes). It is not the key field. This field is the first text box on a form. I would like to check to make sure the...
1
1546
by: d9pierce | last post by:
Hi all, I have a company form that I would like to protect against duplication unless checked. Main point being, that I dont want to just be able to add a duplicate company name in a test box...
8
3908
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...
5
2572
by: Alan Little | last post by:
I have affiliates submitting batches of anywhere from 10 to several hundred orders. Each order in the batch must include an order ID, originated by the affiliate, which must be unique across all...
3
1313
by: geo039 | last post by:
I have a simple application that takes user input by text and time selected by date time picker. It displays the appt description in one list box and the time in another list box. I need a simple...
20
14351
by: technocraze | last post by:
Hi guys & commnunity experts, Does anyone knw how to go about checking for existing data in an MS Acess table? I have tried out the following code using vb but doesnt seem to work that well? Can...
2
2532
by: Ranma13 | last post by:
Hello, I have a duplicate record check written in VB for a check in/check out database. Here's the pseudocode, written for the BeforeUpdate property on the form: If DCount(search for records with...
1
2008
by: gurmet | last post by:
Hi All I have been looking around for help, and finally post this problem. I created a form to edit a record. Before i can click save button on the edit form i need to check if the data that...
0
7205
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
7093
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...
0
7467
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5594
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5022
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4688
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3177
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1521
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
746
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.