Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form/Report Issue

Status
Not open for further replies.

georgesOne

Technical User
Jul 2, 2004
176
JP
Dear All,

I have an access form ("frmCover") which displays an access report ("repMonthly") with four subreports ("rptInst1", "rptInst2", "rptInst3", "rptInst4").

The first two subreports are in a group header section of "repMonthly".

I successfully reference their recordsource - e.g. for "rptInst1" - with:
Forms!frmCover.repMonthly.Report.rptInst1.Report.RecordSource = "SELECT ....." Or
Forms("frmCover").Controls("repMonthly").Report.Controls("rptInst1").Report.RecordSource = "SELECT..."

The latter two reports are located in the report footer.

Attempts to reference them in the same way fails with the info "You entered an expression that has an invalid reference to the property Form/Report".

Any suggestions how to do?

Thanks, georges

 
Based on the error message, my guess is that the subreport control does not have the name that you think it does. Likely the subreport is named "rptInst2", but I will bet that the subreport control (the container for the subreport) has a name like "child1". Click on the control not the contained subreport and verify the names.
 
That was quick...
I will do and let you know.

Thanks anyway, georges
 
Probably not the issue...
When I select the control... in the property sheet appears:
Selection type: Subform/Subreport and in the combobox below "rptInst3".
When I click the "Other" tab under Name appears the same "rptInst3".

Best, georges
 
I have moved the report "rptInst3" into the group header (where the other reports reside which I can reference) and it works also for "rptInst3" then.
Put back in the report footer and I get the same error again.

Best, georges
 
That is strange, there should be no difference in referencing in a header, detail, or footer.
 
I am creating a test form/report now to see what happens....
Thanks for the time being.... georges
 
The only thing I would try is to delete the existing subreport controls. Create in the footer two brand new subreport controls. Add the subreports as source objects. Without seeing it, my only guess would be some type of corruption. Also ensure that in the footer you are not pasting into some other control, like another subreport control.
 
I created the test form with same report configuration... yes, looks like the original form is corrupted as it works OK there.
Thanks for your advice!
Best, georges
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top