Running a Query within a Form

BrianFawcett

Registered User.
Local time
Today, 12:21
Joined
May 3, 2010
Messages
63
I have a report created which has three drop down boxes and a report of data below it.

What I want to do is write a query where the user make their choices in the drop down lists, clicks a 'Run Query' button, and the data is displayed in the table of data beneath the drop downs.

I know how to write a query which can produce the result with set parameters or having the user key them in. But I do not know how to:

1. Write the query so that the parameters are the users choices in the drop down boxes.

2. Write the click button code the execute the query

3. Write/design it so that the results/data is displayed in the report the user is in and not in a new table.

Can anyone help me with any of these, thanks.
 
Thanks, that looks like a good start to what I want to do.

To write the SQL with multiple WHEREs, do I just say AND WHERE after the first one and second one and then end with the ";"
 
Thanks, that looks like a good start to what I want to do.

To write the SQL with multiple WHEREs, do I just say AND WHERE after the first one and second one and then end with the ";"

Here's another sample which, if you look at the code, will show you how to use only the controls which have data. This sample has a combo and two text boxes but it would somewhat be similar.
 

Users who are viewing this thread

Back
Top Bottom