Using an Option Group

G

Guest

I have a form from which I want to allow the user to make
a selection: "select a category" or "all categories" to
print a report. I then have a combo box that displays a
category.

How do I code to print the report that the user chooses
from the option group and the combo box?

Thanks much for any help!
 
P

PC Datasheet

Try using a multi-select listbox rather than a combobox. It will make what you
are wanting to do much simpler.
 
G

Guest

Thank you for your suggestion. How do I code for a multi-
select listbox to print the categories selected from the
box?
 
G

Graham Mandeno

You don't say how you implemented this, but let's assume you apply a filter
to the form when "Select a category" is selected, or when the combo is
updated, and you turn the filter off when "All categories" is selected.

In that case, all you need to do is pass your form's filter on to the
report:

Dim strFilter as String
If Me.FilterOn Then strFilter = Me.Filter
DoCmd.OpenReport "YourReport", , , strFilter
 
P

PC Datasheet

Look at ItemsSelected collection in the Help file. There are two examples there.
 

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