Multi select list boxes to pass selected results to a report

  • Thread starter Thread starter Davidac
  • Start date Start date
D

Davidac

Hi,
i currently have a multi select list box which is populated from a query. i
need to be able to use my selections to pass the results to a report which
runs from the same query. could anyone give me som assistance. my VBA coding
is very basic.
 
Code might look Something like

Dim varItem As Variant, strIn as String

For Each varItem In lstBox.ItemsSelected
' This is where you do something with each Item that was Selected
' We are just appending them one at a time to a string in this
example
strIn = strIn & lstBox.ItemData(varItem) & ", "
Next varItem
' At this point you have a Comma Delimited List of Selected Items
Debug.Print Left(strIn, Len(strIn)-1)

Rdub
 
Back
Top