Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2014

    Unanswered: Multiple sub reports and controls

    I have a report with 10 subReports in it. I want to set a control visible/not on one of the sub reports but get a 2455 error when referencing the control. Invalid reference to the property form/report

    Reports(parent).controls(subReportControlName).rep ort.controls(controlName).visible=true

    I do not have this issue on a report with a single subReport, the same code works fine.

    both reports are open in acViewPreview mode

    Any suggestions on how to get around this problem? Thanks for any help.

  2. #2
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    reports!parentformname!subreportname!controlname.p roperty
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Apr 2014
    I am building the statement out of a table so all the names are out of a record set. The actual code is

    Reports(rstReportElem!strReportObject). _
    Controls(rstReportElem!strSubReport).Report. _
    Controls(rstReportElem!strElement).Visible = rstReportElem!ynoDisplayed

    it is not a bang vs dot issue.

    Get the same error with this test code.

    DoCmd.OpenReport "rptContract", acViewPreview
    Reports!rptContract!subContractDetails.Report!sumE nergySavingsSurface.Visible = True
    Reports!rptContract!subContractDetails.Report!lblS umEnergySavingsSurface.Visible = True

    I believe it is related to the multi sub reports issue. Like I said when I run the same code on a single subReport report it works just fine. If I open the report in design mode the test code works. Perhaps the answer is to open it in design mode, set the form up, save it, reopen in in preview but, there must be a simpler way to reset the report

Tags for this Thread

Posting Permissions

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