
January 8th, 2013, 12:58 PM
|
 |
Contributing User
|
|
|
|
Generating Access DB Report with multiple where conditions
I am having some trouble adding a second where condition to my report cmdlet. This is what I currently has:
Code:
DoCmd.OpenReport "rptEvent2", acViewPreview, , "[EDate] Between #" & Format(Startdate, "YYYY/MM/DD") _
& "# and #" & Format(Enddate, "YYYY/MM/DD") & "#"
It works properly, opening a report according to the dates specified, however I would also like to parse the report based on service type. I have a form with a multi selectable listbox that outputs the selected items to a comma delimited variable. I would like to add a where clause that outputs services that have been selected (in the s variable).
EDIT/UPDATE:
I got the following to work:
Code:
DoCmd.OpenReport "rptEvent", acViewPreview, , "[ServiceName]='ServiceNAMEhere' AND [EDate] Between #" & Format(Startdate, "YYYY/MM/DD") _
& "# and #" & Format(Enddate, "YYYY/MM/DD") & "#"
But I still need to find out how to check for multiple items from a comma delimited string. It has also been braught to my attention that I may be able to use the built in filter with openreport, but unsure how to implement for multiple items.
Last edited by Nullified : January 8th, 2013 at 01:30 PM.
|