multiple selection in list box

  • Thread starter Thread starter Michael
  • Start date Start date
M

Michael

Hi,

I need to create a list box where the user can select
multiple rows, and then click a "Filter" button. A form
containing the records that were selected in the list box
should appear. Any help would be greatly appreciated!

Michael
 
Something like this, perhaps:

Dim strFilter As String
Dim lngLoop As Long
strFilter = ""
For lngLoop = 0 - ListBoxName.ColumnHeads To lstBoxName.ListCount - 1
If ListBoxName.Selected(lngLoop) = True Then _
strRptFilter = strRptFilter & "FieldName=" & _
ListBoxName.ItemData(lngLoop) & " Or "
Next lngLoop
If Len(strRptFilter) > 4 Then strRptFilter = Left(strRptFilter,
Len(strRptFilter) - 4)
DoCmd.OpenForm "formname", , , strRptFilter
 
Back
Top