1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Rep Power

    Exclamation 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:
    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).

    I got the following to work:
    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 02:30 PM.
    Free Domain Names || Free Web Hosting

IMN logo majestic logo threadwatch logo seochat tools logo