Any way to control sub-reports?

  • Thread starter Thread starter Alp Bekisoglu
  • Start date Start date
A

Alp Bekisoglu

Hi Experts,

Me back again after a nice crash!

The question is: is there a way to control what gets included to a report as
a sub-report?

Unfortunately I badly need an (if possible) urgent answer.

Thanks in advance.

Alp
 
Alp:

Your question does not have enough information to allow a response. i.e.

1.) If you have a sub report, you can use the link master / link child
properties of the sub report to limit its records to those that are the
current record in the main report.
2.) If you want to change the record source of the sub report, that's
another matter and it can usually only be manipulated once during the
opening of the main report.

More information on the issue would lead to a more targeted response.
 
Hi and thanks for a quick response. I'm sorry to jot the previous message in
a hurry and omit details.
Here they are:
Actually my quest for an answer is more like your second option. I would
like (if possible) to change the sub-report that gets included/embedded into
the main. I have all necessary alternative sub-reports available within the
DB. The only issue is to select which ones are included.
Is this possible? Via VB?

Thanks again.

Alp
 
Sorry Steve,

Some more forgotten details:
Report in question is an 8 page report. According to the circumstances, i.e.
the year it belongs to, there are different sub's that need to be used.
All subs have their own record sources and the report is just used to gather
all 8 under one umbrella for ease of use.
I am ready to provide further info if necessary. This is all that came to my
mind worth mentioning.

Alp
 
Alp:

The only way to do that is open the report in design mode and then change
the Source Object property of the subreport control. As in:

On Error resume next
Docmd.Echo False
Docmd.OpenReport "MyReport", acViewDesign
Reports![My Report]!MySubreportControl.SourceObject = "some new subreport"
Docmd.Close acReport, "MyReport", acSaveTrue
Docmd.Echo True
 
Thank you for your help Steve, I will try it with this code. One last
question though; is it necessary that the report be saved or could I just
open as preview and let the user print if chose to? Save could take some
time and this routine will be run at each report request, for this
particular report with 8 sub-reports.

Alp

SA said:
Alp:

The only way to do that is open the report in design mode and then change
the Source Object property of the subreport control. As in:

On Error resume next
Docmd.Echo False
Docmd.OpenReport "MyReport", acViewDesign
Reports![My Report]!MySubreportControl.SourceObject = "some new subreport"
Docmd.Close acReport, "MyReport", acSaveTrue
Docmd.Echo True
--
Steve Arbaugh
ACG Soft
http://ourworld.compuserve.com/homepages/attac-cg

Alp Bekisoglu said:
Hi and thanks for a quick response. I'm sorry to jot the previous message
in
a hurry and omit details.
Here they are:
Actually my quest for an answer is more like your second option. I would
like (if possible) to change the sub-report that gets included/embedded
into
the main. I have all necessary alternative sub-reports available within
the
DB. The only issue is to select which ones are included.
Is this possible? Via VB?

Thanks again.

Alp
 
Alp:

Save should not be required. In fact if the actual db file is shared by
multiple users a save may not even be possible due to file locks.
--
Steve Arbaugh
ACG Soft
http://ourworld.compuserve.com/homepages/attac-cg

Alp Bekisoglu said:
Thank you for your help Steve, I will try it with this code. One last
question though; is it necessary that the report be saved or could I just
open as preview and let the user print if chose to? Save could take some
time and this routine will be run at each report request, for this
particular report with 8 sub-reports.

Alp

SA said:
Alp:

The only way to do that is open the report in design mode and then change
the Source Object property of the subreport control. As in:

On Error resume next
Docmd.Echo False
Docmd.OpenReport "MyReport", acViewDesign
Reports![My Report]!MySubreportControl.SourceObject = "some new
subreport"
Docmd.Close acReport, "MyReport", acSaveTrue
Docmd.Echo True
--
Steve Arbaugh
ACG Soft
http://ourworld.compuserve.com/homepages/attac-cg

Alp Bekisoglu said:
Hi and thanks for a quick response. I'm sorry to jot the previous message
in
a hurry and omit details.
Here they are:
Actually my quest for an answer is more like your second option. I
would
like (if possible) to change the sub-report that gets included/embedded
into
the main. I have all necessary alternative sub-reports available within
the
DB. The only issue is to select which ones are included.
Is this possible? Via VB?

Thanks again.

Alp


Alp:

Your question does not have enough information to allow a response. i.e.

1.) If you have a sub report, you can use the link master / link child
properties of the sub report to limit its records to those that are
the
current record in the main report.
2.) If you want to change the record source of the sub report, that's
another matter and it can usually only be manipulated once during the
opening of the main report.

More information on the issue would lead to a more targeted response.


--
Steve Arbaugh
ACG Soft
http://ourworld.compuserve.com/homepages/attac-cg

Hi Experts,

Me back again after a nice crash!

The question is: is there a way to control what gets included to a
report
as
a sub-report?

Unfortunately I badly need an (if possible) urgent answer.

Thanks in advance.

Alp
 
Back
Top