Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2004
    Posts
    156

    Unanswered: Subreport RecordSource

    Hello, everybody:

    I'm having problems setting the recordsource property for a subreport during the Open event of the main report.

    I've tried using:

    Me.srptControlName.Report.RecordSource

    but it kept giving me errors.

    There's probably something simple or not obvious that I'm missing. Thanks in advance!
    DocX

    The teachings of God's Begotten: 2 John 1:9

  2. #2
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1

    Lightbulb

    Try

    Forms!MainForm!SubForm.Form.RecordSource

  3. #3
    Join Date
    Jul 2004
    Posts
    156
    I'm trying this on a report.
    DocX

    The teachings of God's Begotten: 2 John 1:9

  4. #4
    Join Date
    Jun 2004
    Location
    Florida, US
    Posts
    521
    why do you need to change recordsource of the report?
    ghozy.

  5. #5
    Join Date
    Jul 2004
    Posts
    156
    I have a form where they choose options for a report and which report type they want to open. If one of the options is not chosen I do not need to run a certain subreport and its underlying query. I could, as I have it set to do now, let it always run but just set the visible property to false when the option is not checked. But that would take load time and, with large amounts of data, could slow it down.

    So, I need to set the subpreports record source to "" so that it will not run the query when not needed.
    DocX

    The teachings of God's Begotten: 2 John 1:9

  6. #6
    Join Date
    Jun 2004
    Location
    Florida, US
    Posts
    521
    you could create a copy of this report without subreport, and call it instead original one when you need a report without subreport.
    ghozy.

Posting Permissions

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