Report RecordSource

  • Thread starter Thread starter Warrio
  • Start date Start date
W

Warrio

Hello!!

Is it possible to change a report's recordsource before open it?

when I click on buton located on my form, I have the following code:

Report_myReport.RcordSource = "Select * from my Table"
DoCmd.OpenReport "myReport, acPreview

The code runs untill the line where the recordsource is changed and an
Visual C++ Runtime error appears and tells that Access asks to close the
application.

and then MS Access closes!!

Is there an easy way to change the RecordSource of a report before
despalaying the report???
 
Warrio said:
Is it possible to change a report's recordsource before open it?

when I click on buton located on my form, I have the following code:

Report_myReport.RcordSource = "Select * from my Table"
DoCmd.OpenReport "myReport, acPreview

The code runs untill the line where the recordsource is changed and an
Visual C++ Runtime error appears and tells that Access asks to close the
application.

and then MS Access closes!!

Is there an easy way to change the RecordSource of a report before
despalaying the report???

No! You have to set the recordsource property from within
the report's Open event.
 
Back
Top