Combo Box Select for Report

G

Guest

I have a query that feeds a report. It has a field called "Tasks". In this
field I have text strings such as: Project Management, Marketing, Financial
Reporting etc. Each has an associated cost. Needless to say there are A LOT
of tasks which makes a long report. What I would like to do is when a user
opens this report there is a combo box prompt that has all the Tasks listed.
I would like the user to be able to scroll down the list, select one, and the
report will only populate with that data. I know how to do this if the person
just types the task in but I would like a combo box that allows the user to
scroll to find the task they desire. Any help would be greatly appreciate!
Thanks in advance!
 
F

fredg

I have a query that feeds a report. It has a field called "Tasks". In this
field I have text strings such as: Project Management, Marketing, Financial
Reporting etc. Each has an associated cost. Needless to say there are A LOT
of tasks which makes a long report. What I would like to do is when a user
opens this report there is a combo box prompt that has all the Tasks listed.
I would like the user to be able to scroll down the list, select one, and the
report will only populate with that data. I know how to do this if the person
just types the task in but I would like a combo box that allows the user to
scroll to find the task they desire. Any help would be greatly appreciate!
Thanks in advance!

Create an unbound form.
Add a combo box.
Set the Row Source of the combo box to include the
Tasks field. Something like:
"Select TableName.Tasks from TableName Order By Tasks;"
(change the table and Field names to whatever the actual names are.)
Name the Combo Box 'cboFindTask'.
Set it's Bound column to 1.
Set it's Column Count to 1.
Set the Column Width property to 1"
Set it's LimitToList property to Yes.

Add a Command Button to the form.
Code the button's click event:

Me.Visible = False

Name this form 'ParamForm'.

In the Query [Tasks] field criteria line write:
forms!ParamForm!cboFindTask

Next, code the report's Open event:
DoCmd.OpenForm "ParamForm", , , , , acDialog

Code the report's Close event:
DoCmd.Close acForm, "ParamForm"

When ready to run the report, open the report.
The form will open and wait for the selection of the Task.
Click the command button and then report will run.
When the report closes, it will close the form.
 
G

Guest

Great. Thanks I will try this!

fredg said:
I have a query that feeds a report. It has a field called "Tasks". In this
field I have text strings such as: Project Management, Marketing, Financial
Reporting etc. Each has an associated cost. Needless to say there are A LOT
of tasks which makes a long report. What I would like to do is when a user
opens this report there is a combo box prompt that has all the Tasks listed.
I would like the user to be able to scroll down the list, select one, and the
report will only populate with that data. I know how to do this if the person
just types the task in but I would like a combo box that allows the user to
scroll to find the task they desire. Any help would be greatly appreciate!
Thanks in advance!

Create an unbound form.
Add a combo box.
Set the Row Source of the combo box to include the
Tasks field. Something like:
"Select TableName.Tasks from TableName Order By Tasks;"
(change the table and Field names to whatever the actual names are.)
Name the Combo Box 'cboFindTask'.
Set it's Bound column to 1.
Set it's Column Count to 1.
Set the Column Width property to 1"
Set it's LimitToList property to Yes.

Add a Command Button to the form.
Code the button's click event:

Me.Visible = False

Name this form 'ParamForm'.

In the Query [Tasks] field criteria line write:
forms!ParamForm!cboFindTask

Next, code the report's Open event:
DoCmd.OpenForm "ParamForm", , , , , acDialog

Code the report's Close event:
DoCmd.Close acForm, "ParamForm"

When ready to run the report, open the report.
The form will open and wait for the selection of the Task.
Click the command button and then report will run.
When the report closes, it will close the form.
 
G

Guest

I tried your suggestion. The form launched prior to the report & I was able
to select from the combo box & use the command button to open the report.
But, all of the slots on the report were empty.

I re-tested my query by replacing "Forms!ParamForm!cboFindTask" with [Enter
code:] in order to use the default entry box & key in the value. I also
removed the event procedures from the report. Without the pop-up form, the
query filled up with the proper data.

I think I am losing my data between the command button on the new form and
the query, I just can't seem to fix it.

Any ideas? Your suggestions so far have been great.

fredg said:
I have a query that feeds a report. It has a field called "Tasks". In this
field I have text strings such as: Project Management, Marketing, Financial
Reporting etc. Each has an associated cost. Needless to say there are A LOT
of tasks which makes a long report. What I would like to do is when a user
opens this report there is a combo box prompt that has all the Tasks listed.
I would like the user to be able to scroll down the list, select one, and the
report will only populate with that data. I know how to do this if the person
just types the task in but I would like a combo box that allows the user to
scroll to find the task they desire. Any help would be greatly appreciate!
Thanks in advance!

Create an unbound form.
Add a combo box.
Set the Row Source of the combo box to include the
Tasks field. Something like:
"Select TableName.Tasks from TableName Order By Tasks;"
(change the table and Field names to whatever the actual names are.)
Name the Combo Box 'cboFindTask'.
Set it's Bound column to 1.
Set it's Column Count to 1.
Set the Column Width property to 1"
Set it's LimitToList property to Yes.

Add a Command Button to the form.
Code the button's click event:

Me.Visible = False

Name this form 'ParamForm'.

In the Query [Tasks] field criteria line write:
forms!ParamForm!cboFindTask

Next, code the report's Open event:
DoCmd.OpenForm "ParamForm", , , , , acDialog

Code the report's Close event:
DoCmd.Close acForm, "ParamForm"

When ready to run the report, open the report.
The form will open and wait for the selection of the Task.
Click the command button and then report will run.
When the report closes, it will close the form.
 

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