Multi-select List Boxes

  • Thread starter Thread starter Mary
  • Start date Start date
M

Mary

I'm new to using multi-select boxes. I have several set
up on a form. I'd like to be able to make selections from
each list, then run a report based on the selections.
The lists are set up and I am able to select multiple
items or "ALL". Is there an article on the next step to
bring it all together? I'm thinking I need a button that
will run the query or report based on the selections
made. If the results could be automatically formatted in
an Excel spreadsheet, that would be even better, but a
query or report would be fine. Any help is greatly
appreciated!
 
You will need to provide the information via code to filter the report's
recordsource query. Something like this, perhaps:

Dim strRptFilterAs String
Dim lngLoop As Long
strRptFilter= ""
For lngLoop = 0 - [LBX-Departments].ColumnHeads To
[LBX-Departments].ListCount - 1
If [LBX-Departments].Selected(lngLoop) = True Then _
strRptFilter = strRptFilter & "FieldName=" & _
[LBX-Departments].ItemData(lngLoop) & " Or "
Next lngLoop
If Len(strRptFilter) > 4 Then strRptFilter = Left(strRptFilter,
Len(strRptFilter) - 4)
DoCmd.OpenReport "ReportName", , , strRptFilter
 

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

Similar Threads

Multi-Select 0
Multi Select List Boxes 19
List box 2
multi select list box? 3
multi select list box if nothing selected 12
List box 2
Access 2003 Data Not Saving? 0
Multi-Select LIst Box Not Appearing in Text Box 2

Back
Top