smiley1978
Board Regular
- Joined
- Sep 13, 2005
- Messages
- 133
I need to edit the record source of a report using VBA but I do not know the code to set the Report.
In the past, I have used the following lines of code to update various properties in queries or to add records to tables.
Set db = CurrentDb
Set rst = db.QueryDefs("QueryName")
Set ULrst = dbs.OpenRecordset("TableName")
I am looking for the same code that would allow me to set a report something like below.
Set RptDef = db.ReportDefs("ReportName")
I am trying to change the RowSource SQL of a report based on selections made on a form.
In the past, I have used the following lines of code to update various properties in queries or to add records to tables.
Set db = CurrentDb
Set rst = db.QueryDefs("QueryName")
Set ULrst = dbs.OpenRecordset("TableName")
I am looking for the same code that would allow me to set a report something like below.
Set RptDef = db.ReportDefs("ReportName")
I am trying to change the RowSource SQL of a report based on selections made on a form.