List Pulldown Box in Query

  • Thread starter Thread starter TM
  • Start date Start date
T

TM

I have a parameter query that requests department,start and end date. I
would like the query to have a pull down menu of available departments.
I have achieved this to some degree but I am unable to get a report to rin
from the query. I get the info, but in query format.
I managed the above by creating a custom form with a drop down list that
runs before the query.
Is there an easier way to do it, or am I close to the required result?

Thanks

TM
 
I have a parameter query that requests department,start and end date. I
would like the query to have a pull down menu of available departments.
I have achieved this to some degree but I am unable to get a report to rin
from the query. I get the info, but in query format.
I managed the above by creating a custom form with a drop down list that
runs before the query.
Is there an easier way to do it, or am I close to the required result?

Thanks

TM

The report doesn't run "from a query".
Is the Query the Report's Record Source?
If not, make it so.

Then in the Report's Open event, code
Docmd.OpenForm "FormName", , , , , acDialog

In the Report's Close event, code:
DoCmd.Close acForm, "FormName"

Add a command button to the Form.
Set it's Click event to:
Me.Visible = False

In the Query, set each criteria field to:
forms!FormName!ControlName

Run the Report. The report will open the form. Enter the parameters.
When you click the command button, the report will display the data.
When the report is closed, it will close the form.
You do NOT see the query.
 
Back
Top