Tom,
Bellow you see the practical application of Paul's demonstration:
Code:
If Me!lstStates.ItemsSelected.Count > 0 Then
For Each varItem In Me!lstStates.ItemsSelected
strCriteria = strCriteria & "'" & Me!lstStates.ItemData(varItem) & "',"
ReportFileName = ReportFileName & "_" & Replace(Me!lstStates.ItemData(varItem), "/", "_")
Next varItem
'trim trailing comma from strCriteria.
strCriteria = Left(strCriteria, Len(strCriteria) - 1)
'Build the final ReportFileName.
ReportFileName = Mid(ReportFileName, 2) & ".pdf"
'Build the new SQL statement incorporating the string
strSQL = "SELECT * FROM T01_SourceData " & "WHERE T01_SourceData.State IN(" & strCriteria & ");"
Debug.Print strSQL
'Apply the new SQL statement to the query
qdf.SQL = strSQL
'ReportFileName = Replace(Me!lstStates.ItemData(varItem), "/", "_") & ".pdf"
OutputPathFileName = ReportPath & ReportFileName
Debug.Print OutputPathFileName
'DoCmd.OutputTo acOutputReport, "Report", acFormatPDF, OutputPathFileName, False
'Next varItem
Else
MsgBox "Please selete one or more States"
End If
You can delete the red lines after the testing.
I presume that you want all the names of states into report's filename.
Also, I suggest to avoid blank spaces in path strings and filenames.