How to change recordsource of report with code

  • Thread starter Thread starter Martin
  • Start date Start date
How can I change the record source of a report with code?

Martin.

You haven't given a heck of a lot to go on :-(

One way is to code the Open Event of the report:
If forms!FormName!SomeControl = SomeCriteria Then
Me.RecordSource = "Query1"
Else
Me.RecordSource = "Query2"
End If

If you need more, you'll have to give more.
 
Thank you, this was enough.

Martin.


fredg said:
You haven't given a heck of a lot to go on :-(

One way is to code the Open Event of the report:
If forms!FormName!SomeControl = SomeCriteria Then
Me.RecordSource = "Query1"
Else
Me.RecordSource = "Query2"
End If

If you need more, you'll have to give more.
 
Back
Top