hi guys,
I am using the following code (which I obtained from Multi-Select Listbox)
for some reason, I m getting missing syntax error 3075
10 hours and 20 ciggis and 12 bears and no solution.....
please help someone??
Regards,
L
I am using the following code (which I obtained from Multi-Select Listbox)
Code:
Private Sub cmdOpenReport_Click()
Dim strWhere As String
Dim ctl As Control
Dim varItem As Variant
'make sure a selection has been made
If Me.CList.ItemsSelected.Count = 0 Then
MsgBox "Must select at least 1 employee"
Exit Sub
End If
'add selected values to string
Set ctl = Me.CList
For Each varItem In ctl.ItemsSelected
'strWhere = strWhere & ctl.ItemData(varItem) & ","
'Use this line if your value is text
strWhere = strWhere & "'" & ctl.ItemData(varItem) & "',"
Next varItem
'trim trailing comma
strWhere = Left(strWhere, Len(strWhere) - 1)
'open the report, restricted to the selected items
DoCmd.OpenReport "Report", acPreview, , "*Client Name IN(" & strWhere & ")"
End Sub
for some reason, I m getting missing syntax error 3075
10 hours and 20 ciggis and 12 bears and no solution.....
please help someone??
Regards,
L