I have a form that when you click a command button, will tell an existing report to print. But I want to pass an SQL statement to the report’s record source before it prints so it prints exactly what I want.
When I try to do the following command:
[tt]
Application.Reports(“MyReport”).RecordSource = strSQL
[/tt]
I get the following error:
The report name ‘MyReport’ you entered is misspelled or refers to a report that isn’t open or doesn’t exist.
The SQL command I am sending is valid and the report does exist.
How can I set the record source for a report before I print it?
tia,
GGleason
When I try to do the following command:
[tt]
Application.Reports(“MyReport”).RecordSource = strSQL
[/tt]
I get the following error:
The report name ‘MyReport’ you entered is misspelled or refers to a report that isn’t open or doesn’t exist.
The SQL command I am sending is valid and the report does exist.
How can I set the record source for a report before I print it?
tia,
GGleason