On Wed, 6 Feb 2008 11:22:01 -0800, Allison wrote:
> Hello,
>
> I asked and received the below advice for how to print a set of labels
> one-time only, below the page header.
>
> This code does do that. But, it leaves all the white space reserved for
> this on each successive page.
>
> How do I get rid of all the white space on each successive page, so that the
> detail prints right after the header?
>
> Thanks for any help you can give.
>
> Prior advice:
>
> On Mon, 4 Feb 2008 12:38:00 -0800, Allison wrote:
>
>> Access 2003, XP SP 2
>>
>> I have a report, grouped by alphabet.
>>
>> I need one set of instructions BELOW the page header, on the first page
>> only. Same for end of report.
>>
>> Like this:
>>
>> {Page Header}
>>
>> [One-time text on first page only]
>>
>> {Group Header}
>>
>> [Detail]
>>
>> [One-time text on last page only]
>>
>> {Page Footer}
>>
>> I tried using {Report Header}, but it prints the Rpt Header first, then the
>> Page Header and I need it reversed.
>>
>> Any suggestions?
>
> Add a control to the report that computes [Pages] (if you don't
> already have one, i.e. = "Page " & [Page] & " of " & [Pages]).
> You can make it not visible if you don't want to display it.
>
> Add whatever text boxes you need to the top portion of the Group
> Header.
> Then code the Group Header Format event:
> Me.[ControlName1].Visible = Me.[Page] = 1
> Me.[ControlName2].Visible = Me.[Page] = 1
> etc.
>
> Those controls will only appear on the first page.
>
> Do similar for the Group Footer controls, except this time place the
> controls at the bottom portion of the Footer and code the GroupFooter
> Format event:
>
> Me.[ControlName1].Visible = Me.[Page] = [Pages]
> Me.[ControlName2].Visible = Me.[Page] = [Pages]
> etc.
>
> These controls will only appear on the last page group footer.
>
> Set the GroupHeader and GroupFooter CanShrink property to Yes.
You can do this. Here is my method just for the group header. You can
adapt it for the group footer portion.
You have to determine beforehand where the top of each control is
going to print in the Group Header section, It's easy enough.
Position the controls where you wish them to be. Then write down each
control's Top property value.
Next make note of the Group Header's Height property value.
My example below will show 4 labels I wish to show just on page 1.
[LastName] is a control I wish to show on all pages.
Note: All measurements are in Twips, 1440 per inch. So if the top
property of one of your controls read 1.38", you would use 1.38 * 1440
in the code below.
My example simply spaces the controls 1/2-inch apart, starting at .1
inch from the top.
The Page 1 Height of the GroupHeader is 3 inches.
On each additional page the height will be .5 inch
Code the GroupHeader Format event:
IIf Me.[Page] = 1 Then
Me.GroupHeader0.Height = 3 * 1440
Me.Label383.Visible = True
Me.Label383.Top = 0.1 * 1440
Me.Label384.Visible = True
Me.Label384.Top = 0.6 * 1440
Me.Label385.Visible = True
Me.Label385.Top = 1.1 * 1440
Me.Label386.Visible = True
Me.Label386.Top = 1.6 * 1440
Me.[LastName].Top = 2.6 * 1440
Else
Me.Label383.Top = 0
Me.Label383.Visible = False
Me.Label384.Top = 0
Me.Label384.Visible = False
Me.Label385.Top = 0
Me.Label385.Visible = False
Me.Label386.Top = 0
Me.Label386.Visible = False
Me.[LastName].Top = 0.1 * 1440
Me.GroupHeader0.Height = 0.5 * 1440
End If
The above code will display the 4 labels (Label383 - Label 386) on
page 1 above the [LastName] in the Group Header.
On subsequent pages, only the [LastName] will appear, just .1 inch
below the Page Header.
The height of the GroupHeader will shrink to .5 inch.
Adjust all of these measurements to whatever you require.
Do similar code in the GroupFooter Format event, using
If [Page] = [Pages] instead of If [Page] = 1
I'm sure you'll be able to adapt this.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
|