Query with a twist %%

G

Guest

I have a report that run a query which a user enters a date on a dialog box
and the report runs, which works fine. Here is the twist. The use want to run
the same query (Report), with the date in the critieria field (dialog box)
BUT, the user also wants to select a department as well. I have the
departments in a table, but how do I let the user select the departments and
enter the date as well in a query? I could have the user type in the
department by using "[Enter Dept]" in the critieria field, but some of the
departments are long. HELP!!
 
G

Guest

bladelock,

Create a form with unbound controls for the criteria, text field for the
date and a combo box for the departments (combo box row source being the
departments table.

Have the controls on this form as the query criteria for the report and
trigger the report from a button on the form

hope this helps.
 
G

Guest

Sorry, but i'm new to all this advance stuff. I can create a form with a text
box and combo box, how to I setup the query portion? Thanks

R.Douthwaite said:
bladelock,

Create a form with unbound controls for the criteria, text field for the
date and a combo box for the departments (combo box row source being the
departments table.

Have the controls on this form as the query criteria for the report and
trigger the report from a button on the form

hope this helps.


--
R.Douthwaite.> I have a report that run a query which a user enters a date
on a dialog box
and the report runs, which works fine. Here is the twist. The use want to run
the same query (Report), with the date in the critieria field (dialog box)
BUT, the user also wants to select a department as well. I have the
departments in a table, but how do I let the user select the departments and
enter the date as well in a query? I could have the user type in the
department by using "[Enter Dept]" in the critieria field, but some of the
departments are long. HELP!!
 
G

Guest

bladelock,

I would suggest taking a look at Rogers example, I just took a look and I
think it will point you in the right direction, it might take a while for you
to unpick it but the exercise will be well worthwhile.

Once you have setup the form with the text box and combo box your query
needs to use the controls on the form as criteria. In the criteria area of
the query design refer to the relevant conrtol i.e.

[Forms]![formName]![Combo1]

Where the Combo1 is the name of the control on the form

Remember the form has to be open when the query runs!

Good luck

--
R.Douthwaite.



bladelock said:
Sorry, but i'm new to all this advance stuff. I can create a form with a text
box and combo box, how to I setup the query portion? Thanks

R.Douthwaite said:
bladelock,

Create a form with unbound controls for the criteria, text field for the
date and a combo box for the departments (combo box row source being the
departments table.

Have the controls on this form as the query criteria for the report and
trigger the report from a button on the form

hope this helps.


--
R.Douthwaite.> I have a report that run a query which a user enters a date
on a dialog box
and the report runs, which works fine. Here is the twist. The use want to run
the same query (Report), with the date in the critieria field (dialog box)
BUT, the user also wants to select a department as well. I have the
departments in a table, but how do I let the user select the departments and
enter the date as well in a query? I could have the user type in the
department by using "[Enter Dept]" in the critieria field, but some of the
departments are long. HELP!!
 

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