How do I determine from a subReport the name of the Parent report it is currently opened with

  • Thread starter Thread starter rg
  • Start date Start date
R

rg

I am struggling with the report! .. reference - in reverse.

Common subreport name - subReport

Multiple reports - report1, report2, etc. These reports all use the subReport.

What is the report! reference, in subReport, that will tell me the name of parent report it is currently a child of when opened?

TIA,

Roy
 
Need further help

I made a mistake in the first port. The subreport is not a child it is
just a subreport imbedded on other reports. When using the ME.Parent in
the subreport it fails
as, I assume, there is no parent per se?

Struggling,

Roy
 
You need to use
Me.Parent.Name
if you want the name of the parent returned. If you use just Me.Parent you
will probably get an error.
 
John,

I tried this but get the error message - invalid reference to the parent
object.

Since this subreport is not really as child, (just embedded) and I suppose
by definition has no parent, how does it know what form it is a part of when
it is opened as part of another form?

Is there an active embedded objects collection it knows it is a part of?

Roy
 
rg said:
John,

I tried this but get the error message - invalid reference to the
parent object.

Since this subreport is not really as child, (just embedded) and I
suppose by definition has no parent, how does it know what form it is
a part of when it is opened as part of another form?

Is there an active embedded objects collection it knows it is a part
of?

When a form or report is "embedded" then it IS a child of the report it is
embedded in. Table relationships don't enter into this aspect of Access.
 
Strange, I tested it and it worked for me. Access 2000 Windows XP (Latest
versions of both).
 
rg said:
I tried this but get the error message - invalid reference to the parent
object.


You should only get that error when you open the subreport
independently of a main report.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top