List Box query

  • Thread starter Thread starter Dave K
  • Start date Start date
D

Dave K

I have a form with a combo box and list box. The list box
displays items based on the combo box selection. From the
list box I need to be able to select certain items and
build a query that will eventually result in a report. Is
there an easy way to do this? Does it require creating an
intermediate table to hold the records based on my list
box selections?
 
I suppose the answer would depend on just what your "list box selections"
consist of... but, in general, if you are selecting multiple values in the
List Box, you can write code to use them to create SQL or the WhereCondition
argument of a DoCmd.OpenReport.

I prefer to create SQL and, in the Open event, of the Report, use it to
replace the Report's RecordSource -- if the amount of data is large or if it
is an Access client to a server database.

If you need further detail, follow up with more detail of what you have and
want to do.

Larry Linson
Microsoft Access MVP
 
I want to use the selections in the list box as the basis
for selecting records from a table. The combo box allows
selection of an agency code. The list box will list all
of the sub agencies for the selected agency code. From
the items in the list box I want to pick and choose a
limited number of sub agencies to report on - not
necessarily all of them.

Thanks for your help,
Dave K
 
Back
Top