Duane,
I've been trying to get that listbox code you showed me to work. Maybe you might know where I'm goofing.
I pasted the code in a module and named it modMulitSelect, starting with the BuildIn line and ending with the End Function. My form has 2 listboxes and a start date and end date box as well. I named the listboxes lboTTeam and lboTLocation.
I put this as the commond Ok click:
*I threw the me.visible in there to close the open form*
When I click ok on the form, it closes and brings up another dialog box asking for a parameter for Team. I looked and made sure there were no queries with that prompt. If I click ok on that box, it brings every team in the date range regardless of what team you selected or location.
Any clue as to what is going on?
Thanks - Jeff
I've been trying to get that listbox code you showed me to work. Maybe you might know where I'm goofing.
I pasted the code in a module and named it modMulitSelect, starting with the BuildIn line and ending with the End Function. My form has 2 listboxes and a start date and end date box as well. I named the listboxes lboTTeam and lboTLocation.
I put this as the commond Ok click:
Code:
Private Sub cmdOK_Click()
Dim strWhere As String
strWhere = " 1=1 "
strWhere = strWhere & BuildIn(Me.lboTTeam)
strWhere = strWhere & BuildIn(Me.lboTLocation)
DoCmd.OpenReport "rptStatusReports", acViewPreview, , strWhere
Me.Visible = False
End Sub
When I click ok on the form, it closes and brings up another dialog box asking for a parameter for Team. I looked and made sure there were no queries with that prompt. If I click ok on that box, it brings every team in the date range regardless of what team you selected or location.
Any clue as to what is going on?
Thanks - Jeff