Duplicates

D

DS

I have INSERT SQL code that I run. I'm not quite sure how to do this.
I need to search for duplicates either before or after the code is run.
All of the info is on an unbound field just waiting to be inserted.
How and when do I search for duplicates. I thought maybe DLookUp but
there are 4 fields...

TerminalID
MenuID
StartDay
StartTime

Any help appreciated.
Thanks
DS
 
T

tina

if you mean that you want to prevent a duplication of the *combination* of
the values in those four fields, you can add a multi-field index at the
table level, and set the index's Unique property to Yes. when the SQL
statement is executed, records with non-duplicate data combinations will be
appended, and duplicate combinations will not.

hth
 
D

DS

tina said:
if you mean that you want to prevent a duplication of the *combination* of
the values in those four fields, you can add a multi-field index at the
table level, and set the index's Unique property to Yes. when the SQL
statement is executed, records with non-duplicate data combinations will be
appended, and duplicate combinations will not.

hth
That sounds interesting...how do you add a multi-field index?
Thanks
DS
 
J

John Spencer

To create a multiple field unique index
--Open up the WorkingTable in design mode
--Select View: Index from the menu
--Enter Name for Index in first blank cell under Index Name
--Select one field in the index under Field Name
--Set Unique to Yes
--Move down one line and select the next FieldName
--Continue moving down and selecting fieldnames until all needed are
included.
--Close the index window and close and save the table
 

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

Similar Threads

Table Quandry 11
DLookup Seperate Lines 2
DCount Syntax 6
DLookUP 4
Filtered Records 1
Deleting Duplicates in Excel - Databases 1
Need some PWA help 0
Multi-Select SQL 2

Top