Multiselect listbox for parameter query?

G

Guest

I have a report based on a query, with two parameters from the query chosen
in a form's comboboxes. I want to convert the form to multi-selection
listboxes and still have the rest work. This is the current procedure:

1. When I open the report, the following procedure runs to open the
parameter-input form:
Private Sub Report_Open(Cancel As Integer)
'Open dialog
DoCmd.OpenForm "frmListbox_PartI", , , , , acDialog
End Sub

2. The form has two parameter combo boxes (Project and Area). (There are
multiple Areas within a Project.) The user can choose from the drop-down
list for one or both of the parameters.
3. The parameter choices are passed to the query, which has the criteria
(Like [Forms]![frmListbox_PartI]![cboProject] & "*") for the Project field
and a similar criteria for the Area field.
4. The query passes the values successfully to the report, and I end up with
pages for all the Areas in a Project or a single page for one specific Area
or Project/Area, depending on which comboboxes I used.



I have two problems that I would like to solve:

1. The user will often want to print reports for several Areas (like 20),
but not all the areas within a Project. Currently, they will have to run the
entire procedure twenty times to print out twenty individual areas. I have
tried to use multi-select list boxes instead of combo boxes in my form, but
that returns either all Areas or no Areas, depending on whether i leave "&
"*" " in my query criteria. Is there something special I need to do to make
the query recognize multiple listbox selections?

2. There are two combo boxes on the form, Project and Area. Both list all
of the Projects or Areas in the underlying query/table. If a Project is
selected, is there a way to limit the Area list to only those areas that are
also in that Project? Each Project has multiple Areas.

Thank you.
 

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