append only one record

D

DeVille

Hi
I am trying to make my append query to only append one
record (customer name) from a list that may contain many
duplicates, (see SQL below)

I have made an append query that takes the customers name
from my main parent table 'Entries' and inserts it into
the customer details table 'ContactDetailsTable', the
criteria in the query is based on a text box on my
form 'EntryForm1' ('Forms![EntryForm1]!
[CustomerName]') 'CustomerName' in
this case being the text box where I type the customer
name which becomes the criteria for the query. The
control source for this text box is the 'CustomerName'
field in the 'Entries' table, the append query works fine
as long as the name entered has not been
used before, but if for example there is already 3 people
with the name 'Tom' in the 'entries' table it creates 3
new records in the 'ContactDetailsTable' when I only want
to make one. In short I want my append query to only
append one record from a list that may contain
duplicates
(ps the button that runs the macro to run the query first
saves the
current record in the 'Entries' table)
here is the SQL from the append query

INSERT INTO ContactDetailsTable ( CustomerName )
SELECT Entries.CustomerName
FROM Entries
WHERE (((Entries.CustomerName)=[Forms]![EntryForm1]!
[CustomerName]));
 

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