How would I change a Microsoft Access report's RecordSource
property from a C# Windows Forms handler, using Office.Interop
code?
I need to silently save the report as a PDF, using AccessApp.DoCmd.OutputTo(...)
without any Parameter prompts from Access. So I want to temporarily change RecordSource
to an query defined by the form's code, silently save the PDF report, and then change RecordSource
back to a default.
I've tried something like AccessApp.Reports["Report Name"].RecordSource
but I get errors!
Is there a better way to do this than the way I suggested?