(windows 7 & Access 2013)
I'm really lost on this one. There's a lot of information around that can help, but I haven't been able to mix and match to my needs.
I need to be able to print the report from either multiple selection or "ALL" customers, filtered from a listbox and two textboxes that defines the date range and a button to open the report.
The form has the
"lstCustomers" listbox,
"OrderDate1" unbound textbox,
"OrderDate2" unbound textbox, and
the "cmdOpenreport" button.
The report has six subreports (Printing, Scanning, Shipping, Mounting, Mileage and CD burning) and each subreport's Record source is based on a query.
So far, I've been able to have the listbox to show each customer, plus the "All" at the top of the list. The code for this is shown below:
Code:
SELECT Customers.CustomerID, [ProjectNumber] & " - " & [ProjectName] AS Customer, Customers.ProjectName, Customers.ProjectNumber
FROM Customers
WHERE ((Not (Customers.ProjectName)="Admin"))
UNION Select "0", "(All)" as Bogus, Null, Null as AllChoice
From Customers
ORDER BY ProjectNumber;
HERE is where I am stuck!
I've been trying all sort of methods, from Allen Browne (http://allenbrowne.com/ser-50.html) to other websites/forums.
I can't seem to make anything work!
On one side, Allen Browne says it is better to avoid filtering through queries and instead using the WHERE option within the report to create the desired filter. The problem I see on this approach is the fact that It runs 6 subreports. How can I apply this to each subreport?
On the other hand, I could try to do the filtering from the queries, but I understand that it is not possible for the query to get the multiple selection from the listbox.
Any help is welcome!