|
 |
access thread: Change subreport depending on amount of data
Message #1 by "Steve Sutton" <steve.sutton@s...> on Wed, 31 Jul 2002 14:21:44
|
|
Hi,
I have a report with a subreport on it. The subreport is used to link cars
to the person on the main report, fine if that person has a few cars, but
if they have only one, there is a vast amount of blank space in the middle
of the page.
What I would like to do is change the report to a different one in the
subreport frame depending on the number of records the query has/will find.
First is this possible? and second how do you do it?
Many thanks
Steve Sutton
Message #2 by "Wesley Kendrick" <wez.k@n...> on Wed, 31 Jul 2002 14:19:47 +0100
|
|
Hi Steve, if I undestand you correctly your subreport is a fixed size -
this results in the blank space in the middle of the main report?
You can set the 'can grow' property of your controls to 'yes' and set the
height of the controls and the detail section of the subreport to zero. That
way the detail section of the subreport will only expand as much as is
needed to display the info.
Regards, Wesley Kendrick
----- Original Message -----
From: "Steve Sutton" <steve.sutton@s...>
To: "Access" <access@p...>
Sent: Wednesday, July 31, 2002 2:21 PM
Subject: [access] Change subreport depending on amount of data
> Hi,
>
> I have a report with a subreport on it. The subreport is used to link cars
> to the person on the main report, fine if that person has a few cars, but
> if they have only one, there is a vast amount of blank space in the middle
> of the page.
>
> What I would like to do is change the report to a different one in the
> subreport frame depending on the number of records the query has/will
find.
>
> First is this possible? and second how do you do it?
>
> Many thanks
>
> Steve Sutton
>
Message #3 by "Steve Sutton" <steve.sutton@s...> on Wed, 31 Jul 2002 14:38:51
|
|
> Hi Steve, if I undestand you correctly your subreport is a fixed size -
this results in the blank space in the middle of the main report?
You can set the 'can grow' property of your controls to 'yes' and set the
height of the controls and the detail section of the subreport to zero.
That
way the detail section of the subreport will only expand as much as is
needed to display the info.
Regards, Wesley Kendrick
Thanks Wesley,
But what I want to do is when I only have one record to print in the
subreport is to space it out to fill the page. When I have more than one
record it works fine, fills the space up and looks pretty good.
Cheers
Steve
Message #4 by "Wesley Kendrick" <wez.k@n...> on Wed, 31 Jul 2002 14:37:45 +0100
|
|
Hi Steve, hmm... not sure you can do that, what you might have to do is
create several identical main reports but containg different subreports, and
then chose which report to open, based on the number of records found by the
underlying query.
Regards, Wesley
----- Original Message -----
From: "Steve Sutton" <steve.sutton@s...>
To: "Access" <access@p...>
Sent: Wednesday, July 31, 2002 2:38 PM
Subject: [access] Re: Change subreport depending on amount of data
> > Hi Steve, if I undestand you correctly your subreport is a fixed size -
> this results in the blank space in the middle of the main report?
> You can set the 'can grow' property of your controls to 'yes' and set the
> height of the controls and the detail section of the subreport to zero.
> That
> way the detail section of the subreport will only expand as much as is
> needed to display the info.
> Regards, Wesley Kendrick
>
> Thanks Wesley,
>
> But what I want to do is when I only have one record to print in the
> subreport is to space it out to fill the page. When I have more than one
> record it works fine, fills the space up and looks pretty good.
>
> Cheers
>
> Steve
>
Message #5 by "Steve Sutton" <steve.sutton@s...> on Wed, 31 Jul 2002 14:52:29
|
|
Okay, thanks it was worth a try!
Message #6 by "Amy Wyatt" <amyw@c...> on Wed, 31 Jul 2002 21:23:55
|
|
Actually you can change the referance to a subreport on a report if you do
it in design view like this.
DoCmd.OpenReport "rptMain", acViewDesign
Reports!rptmain.srpt_Main.SourceObject = strSubRpt
DoCmd.OpenReport "rptMain", acViewPreview
Hope this helps.
Amy
> Okay, thanks it was worth a try!
|
|
 |