I haven't worked with Access in 8 years -- I believe I've forgotten more than I ever knew. Someone asked me to modify a report so that a list of drawings, which currently displays all drawings, will list drawings for a specific customer (or for all customers).
I located the nested queries used by the report, and I modified the inner query to accept a parameter (first mistake?). Then I added a new form to display the customer name and retrieve the associated primary key, customerId. Now I need to feed the customer ID from the form to the report. DoCmd.OpenReport and adding a whereCmd doesn't seem to match up the where condition with the parameter.
So, I removed the parameter in the query, and tried just specifying the condition. Only the outer query doesn't know what a customerId is. Do I need to expose this in the inner query, and in the outer query, then just not use it in the final report just so I can filter it in the where clause?
They have other sample code that uses VBA in the form to rebuild a query (adding in whatever criteria for filtering) before launching the report. Surely this can't be the recommended practice, can it?