How to create or change a query in code for a report
Posted on 2014-02-19
In code, I need to change the wording in the data source query in a report. The Report's "built-in" query specifies a range of dates for the Transaction Date field. Can I just create a new SELECT clause and assign it to a string variable and use this in the Filter section of a DoCmd.OpenReport command, thus...
DoCmd.OpenReport "Transactions Report", acViewPreview, NewStringVariable, "HHID = " & ClientNowPrinting
...or do I need to create the query and use the query name in the DoCmd statement?
The text of the query is so long, I wish I could use code to just change the criteria for one field in the design mode some way.