Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

query based on form data

Status
Not open for further replies.

patrichek

MIS
Nov 18, 2003
632
US
Hi,
I'm trying to create an append query based on an open form. I want to take the record that is open in the form and send it off to another database. When I make my query it returns the same record 2853 times (thats the number of records in my db).
what am i doing wrong?
My query fields:

Expr1: [Forms]![Contacts]![contactIDtxt]
Expr2: [Forms]![Contacts]![FirstName]
Expr3: [Forms]![Contacts]![LastName]

now here's my code:

Code:
SELECT [Forms]![Contacts]![FirstName] AS Expr2, [Forms]![Contacts]![LastName] AS Expr3, [Forms]![Contacts]![contactIDtxt] AS Expr1
FROM Contacts;

thanks!
 
A quick and dirty way:
SELECT DISTINCT ...

Another way is to use the INSERT INTO ... VALUES (...) syntax.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
THANKS! that solved that problem now i need to figure out my key violation?

someday PHV i'll show you the db you helped me build! :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top