Controlling subreport recordsource

G

Guest

Greetings… I would very much appreciate a little advice on controlling data
in an unlinked subreport.

I have subreport imbedded in a Main report and the two are unlinked. The
Main report is set up so that each record for the Main report is on a
separate page. On each page of the Main report is enough information for me
to build an SQL statement that I can use to control the recordset for the
subreport.

My dilemma is that the information needed to build the SQL statement for the
subreport is on the Main report and the Main report needs to be open to
develop the SLQ statement. Because the subreport is now also open, the new
SQL statement I pushed to the subreport recordsource query will not show up
until I close the Main report and re-open it.

What I would like to do is have the subreport update for each record (page)
of the Main report without having to open and close the Main report for each
record.

Any help you can offer is appreciated in advance.

Cheers
 
M

Marshall Barton

MechEngr said:
Greetings… I would very much appreciate a little advice on controlling data
in an unlinked subreport.

I have subreport imbedded in a Main report and the two are unlinked. The
Main report is set up so that each record for the Main report is on a
separate page. On each page of the Main report is enough information for me
to build an SQL statement that I can use to control the recordset for the
subreport.

My dilemma is that the information needed to build the SQL statement for the
subreport is on the Main report and the Main report needs to be open to
develop the SLQ statement. Because the subreport is now also open, the new
SQL statement I pushed to the subreport recordsource query will not show up
until I close the Main report and re-open it.

What I would like to do is have the subreport update for each record (page)
of the Main report without having to open and close the Main report for each
record.


You can not change a subreport's RecordSource after it is
opened the first time.

AFAIK, the only way for main report data to affect the
records that are in a subreport is via the Link Master/Child
properties. Other than that, the subreport must be used to
show/hide its own controls. Although not very efficient,
the subreport can use the MobeLayout and PrintSection
properties to ignore some of its detail records.

Are you sure you can not do away with the subreport and join
the two datasets in the main report's record source query?
Sometimes(?), you can use unbound controls in the detail
section to display data from a recordset by using the
NextRecord property.
 
G

Guest

thanks for the info... There is no way to link the two reports without
loosing some very positive attributes of having my current data structure.
Looks like I will have to settle for one record per report.

Thanks again for the help.
 

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

Top