Populating List box

A

Andrew Gould

I have a main form that has a report screen. On that report screen I have
one combo box and one list box. The list box contains the list of all of
the reports in the system. These reports are in certain groups designated
by the client. The combo box has the names of these groups and when you
select a group the list box requerys to show only those reports in that
group. That all works fine, I'm just stuck on how to display "ALL" of the
reports in the list box initially when the form opens since my query in the
Row Source has the parameter of the combo box (when the form opens the
GroupID in the combo box is nothing b/c a group has not been selected).
Also, I would really like to add "ALL" in the actual list so the client can
view all of the reports at the same time.

Thanks people.
 
L

Larry

I assume, your query for the ListBox, contains a Criteria that points to the
ComboBox on your form, so that only reports with that GroupID are selected.

To show all of them, when the ComboBox is empty, change the criteria to:
Like [Forms]![form name]![combobox name] & "*"

This will show all records if the ComboBox is blank, because this will
revert to "Like *".

Now, you may have to change this a bit, if they values you are matching may
pull up like groups. For example, if you have a GroupID of 1 and another of
10, then if they select 1, you would get 1 and 10. But this is the basic way
 
A

Andrew

Thanks, works fine.


Larry said:
I assume, your query for the ListBox, contains a Criteria that points to the
ComboBox on your form, so that only reports with that GroupID are selected.

To show all of them, when the ComboBox is empty, change the criteria to:
Like [Forms]![form name]![combobox name] & "*"

This will show all records if the ComboBox is blank, because this will
revert to "Like *".

Now, you may have to change this a bit, if they values you are matching may
pull up like groups. For example, if you have a GroupID of 1 and another of
10, then if they select 1, you would get 1 and 10. But this is the basic way

Andrew Gould said:
I have a main form that has a report screen. On that report screen I have
one combo box and one list box. The list box contains the list of all of
the reports in the system. These reports are in certain groups designated
by the client. The combo box has the names of these groups and when you
select a group the list box requerys to show only those reports in that
group. That all works fine, I'm just stuck on how to display "ALL" of the
reports in the list box initially when the form opens since my query in the
Row Source has the parameter of the combo box (when the form opens the
GroupID in the combo box is nothing b/c a group has not been selected).
Also, I would really like to add "ALL" in the actual list so the client can
view all of the reports at the same time.

Thanks people.
 

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