setting the record source of a report

L

LHaro

I would like to use vb code to export a report to another folder as an .rtf
file, which i can do. My problem is that my report has parameters. Is there
any way that i can set the recordsource of a report, while it is not open? I
can do it if the report is open in design view, but is there any way around
this?
 
A

Allen Browne

You can programmatically set the RecordSource of the report in its Open
event:

Private Sub Report_Open(Cancel As Integer)
Me.RecordSource = "SELECT ...
End Sub
 
Top