I am using SQL to set the record source of a report based on 2 parameters chosen by the user.
My user selects a table to look in, and then specifies the dates to search between to perform the query. My report works ok for a specified table but as soon as I try and selct a different table the text boxes error out as they are still pointing to the original table, despite the reports record source being correct. For example my reports source is pointing to Table3, and works great as all my text boxes are pointing to Table3 as well - but as soon as I manipulate the Reports recordsource to point to Table2 the text boxes remain pointing to Table3.
So my question is can I change the data source of all my text boxes on my report to reflect the changed SQL in the recordsource of the report. Or would it be feasable to save my SQL as a Query and base my Report on that query (if so how do I save a SQL statement as a query)
solo7
hope I explained it well enough for someone to understand it!
My user selects a table to look in, and then specifies the dates to search between to perform the query. My report works ok for a specified table but as soon as I try and selct a different table the text boxes error out as they are still pointing to the original table, despite the reports record source being correct. For example my reports source is pointing to Table3, and works great as all my text boxes are pointing to Table3 as well - but as soon as I manipulate the Reports recordsource to point to Table2 the text boxes remain pointing to Table3.
So my question is can I change the data source of all my text boxes on my report to reflect the changed SQL in the recordsource of the report. Or would it be feasable to save my SQL as a Query and base my Report on that query (if so how do I save a SQL statement as a query)
solo7
hope I explained it well enough for someone to understand it!