Gonzo
12-14-2001, 06:33 AM
Can someone give me a little help with this pesky ListBox. I have this code set up to view reports from selected branches. The problem is that i keep getting an "Enter Parameter Value for BranchIDtitle" and BranchID is the title for that field. What am I missing here? Any ideas?
Private Sub Command158_Click()
Dim varItem As Variant
Dim strWhere As String
For Each varItem In Me!ListBox.ItemsSelected
strWhere = strWhere & "BranchID =" & Me!ListBox.Column(0, varItem) & " Or "
Next varItem
strWhere = Left(strWhere, Len(strWhere) - 4) 'Remove the last " Or "
DoCmd.OpenReport "Report1", acViewPreview, , strWhere
End Sub
Thanks
Gonzo
[This message has been edited by Gonzo (edited 12-14-2001).]
Private Sub Command158_Click()
Dim varItem As Variant
Dim strWhere As String
For Each varItem In Me!ListBox.ItemsSelected
strWhere = strWhere & "BranchID =" & Me!ListBox.Column(0, varItem) & " Or "
Next varItem
strWhere = Left(strWhere, Len(strWhere) - 4) 'Remove the last " Or "
DoCmd.OpenReport "Report1", acViewPreview, , strWhere
End Sub
Thanks
Gonzo
[This message has been edited by Gonzo (edited 12-14-2001).]