Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2003
    Location
    Belgium
    Posts
    42

    Unanswered: Change recordsource of report?

    Hi,

    Is it possible to change the recordsource of a report?

    I've tried:
    DoCmd.OpenReport "rptreport", acViewDesign
    Report_rptreport.RecordSource = form_frmform.RecordSource

    but this doesn't work...

    any suggestions?

  2. #2
    Join Date
    Feb 2004
    Posts
    199
    DoCmd.OpenReport "rptreport", acViewDesign
    opens report and any changes after that won;t have effect, you should try to change recorsource durring report open, by report event handlers
    MDB, ADP <-> MS SQL + VBA, ADO & RDO, .NET, Oracle, Java/Jsp.

  3. #3
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    In the on Open event of the Report put
    Me.RecordSource="SELECT * FROM yourTable"

  4. #4
    Join Date
    Dec 2003
    Location
    Belgium
    Posts
    42
    indeed, I tried to change the recordsource in de report_on_open event and it works.

    Thanks a lot!

    greetz

  5. #5
    Join Date
    Feb 2004
    Posts
    199
    Yes it'd work until you use ADP, in ADP there is a bug
    MDB, ADP <-> MS SQL + VBA, ADO & RDO, .NET, Oracle, Java/Jsp.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •