I have some VBA code that reads a listbox and uses that info to build 2 sql strings that are used as the record source in a report and it's subreport. This all works fine except when there are too many selections in the list box. I believe there is a 255 character limit somewhere, but, not sure where (report works is I copy the recordsource) or if I can work around it. The sql string ends up looking like:
SELECT Category, Issue, Sum(qryTicketCategorySummaryByWebIDOracleTest.CountOfIssue) AS CountOfIssue FROM qryTicketCategorySummaryByWebIDOracleTest WHERE ((WebID Like 'buick-*' Or WebID Like 'cadillac-*' Or WebID Like 'chevy-*' Or WebID Like 'gm-*' Or WebID Like 'gmps-*' Or WebID Like 'hummer-*' Or WebID Like 'pontiac-*' Or WebID Like 'saab-*' Or WebID Like 'saturn-*'))GROUP BY Category, Issue;
The report's (and supreport's) recordsource gets updated with the sql string on the open event.
I know I could shorten the query name and some other things, but, there could be more selections, so, I need to know if there's a work-around.