Combo box Plus Select all Option

G

Guest

I recently posted that I needed a combo box that would allow me to select a
value from a list in a table or query and generate a report based on it. What
I need now is to have that functionality but be able to include in the combo
box a “show all†option for the report. Can this be done? The following is
my first question and the response that worked but I really need to be able
to also have the flexibility to run the report showing all the tasks if I
need to as well. Any ideas? Thanks in advance!

Here is my original question that was answered:
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 appreciated!
Thanks in advance


I got a great response that worked from FredG which was:

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