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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

USING FORM FIELD VALUE IN A QUERY

Status
Not open for further replies.

osullipa1

Technical User
Jan 11, 2007
1
GB
I want to use a field value in the "where clause" of a query. The field I want to drop the value in to is of type "yes/no". The records contain several of these data types. One example I have used is as follows

select * from people where "gp".

(gp is the field in the record and of type "yes/no". This works ok.

What I want however is to use a value from a form to replace the "where condition" eg

SELECT * FROM PEOPLE
WHERE Forms!MailMergeList!ComboGroupSel;

where the "Forms!MailMergeList!ComboGroupSel" returns the "gp" or what ever value I have selected.

This works but returns every record in the database. Can anyone please tell me how to correct this - it is driving me nuts!!!!

Thanks in advance. Regards Peter
 
A parameter is for value not for keyword nor field name ...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top