Last page of a report

  • Thread starter Thread starter Jon Rowlan
  • Start date Start date
J

Jon Rowlan

Is it possible to change the contents of header for the last page of a
report?

I want to remove the Customer code details as the last page is a summary
across the whole report and is printed on a page on its own.

I have tried setting the caption and visible properties in the report footer
event but they either throw up and error, change all occurances of the
textbox or do nothing.

thanks all,

jON
 
Put this expression into the ControlSource of a text box to show the value
of the CustomerCode on all but the last page:
=IIf([Page] = [Pages], Null, [CustomerCode])
 
Thanks Allen, I knew there had to be a way :-)

jON

Allen Browne said:
Put this expression into the ControlSource of a text box to show the value
of the CustomerCode on all but the last page:
=IIf([Page] = [Pages], Null, [CustomerCode])

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Jon Rowlan said:
Is it possible to change the contents of header for the last page of a
report?

I want to remove the Customer code details as the last page is a summary
across the whole report and is printed on a page on its own.

I have tried setting the caption and visible properties in the report
footer event but they either throw up and error, change all occurances of
the textbox or do nothing.

thanks all,

jON
 
Strangely, a Text Box with a control source of

=IIf([Page]=[Pages],"","Sales Executive")

Instead of a Label always comes out blank??

jON

Allen Browne said:
Put this expression into the ControlSource of a text box to show the value
of the CustomerCode on all but the last page:
=IIf([Page] = [Pages], Null, [CustomerCode])

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Jon Rowlan said:
Is it possible to change the contents of header for the last page of a
report?

I want to remove the Customer code details as the last page is a summary
across the whole report and is printed on a page on its own.

I have tried setting the caption and visible properties in the report
footer event but they either throw up and error, change all occurances of
the textbox or do nothing.

thanks all,

jON
 
Do you have any code that is altering the Page or Pages of the report?

Add 2 more text boxes, with ControlSource:
=[Page]
and
=[Pages]
respectively. Can you see why Page and Pages are always equal?

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Jon Rowlan said:
Strangely, a Text Box with a control source of

=IIf([Page]=[Pages],"","Sales Executive")

Instead of a Label always comes out blank??

jON

Allen Browne said:
Put this expression into the ControlSource of a text box to show the
value of the CustomerCode on all but the last page:
=IIf([Page] = [Pages], Null, [CustomerCode])


Jon Rowlan said:
Is it possible to change the contents of header for the last page of a
report?

I want to remove the Customer code details as the last page is a summary
across the whole report and is printed on a page on its own.

I have tried setting the caption and visible properties in the report
footer event but they either throw up and error, change all occurances
of the textbox or do nothing.

thanks all,

jON
 
I have threee fields ...

a) Label with "Sales Exec"

b) Text Box for "Exec Code"

c) Text Box for "Exec Name"

b) and c) work with your logic but a) comes up blank regardless

so I think that [Page] and [Pages] logic must be working fine.

jON


Allen Browne said:
Do you have any code that is altering the Page or Pages of the report?

Add 2 more text boxes, with ControlSource:
=[Page]
and
=[Pages]
respectively. Can you see why Page and Pages are always equal?

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Jon Rowlan said:
Strangely, a Text Box with a control source of

=IIf([Page]=[Pages],"","Sales Executive")

Instead of a Label always comes out blank??

jON

Allen Browne said:
Put this expression into the ControlSource of a text box to show the
value of the CustomerCode on all but the last page:
=IIf([Page] = [Pages], Null, [CustomerCode])


Is it possible to change the contents of header for the last page of a
report?

I want to remove the Customer code details as the last page is a
summary across the whole report and is printed on a page on its own.

I have tried setting the caption and visible properties in the report
footer event but they either throw up and error, change all occurances
of the textbox or do nothing.

thanks all,

jON
 
I have threee fields ...

a) Label with "Sales Exec"

b) Text Box for "Exec Code"

c) Text Box for "Exec Name"

b) and c) work with your logic but a) comes up blank regardless

so I think that [Page] and [Pages] logic must be working fine.

jON

Allen Browne said:
Do you have any code that is altering the Page or Pages of the report?

Add 2 more text boxes, with ControlSource:
=[Page]
and
=[Pages]
respectively. Can you see why Page and Pages are always equal?

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Jon Rowlan said:
Strangely, a Text Box with a control source of

=IIf([Page]=[Pages],"","Sales Executive")

Instead of a Label always comes out blank??

jON

Put this expression into the ControlSource of a text box to show the
value of the CustomerCode on all but the last page:
=IIf([Page] = [Pages], Null, [CustomerCode])


Is it possible to change the contents of header for the last page of a
report?

I want to remove the Customer code details as the last page is a
summary across the whole report and is printed on a page on its own.

I have tried setting the caption and visible properties in the report
footer event but they either throw up and error, change all occurances
of the textbox or do nothing.

thanks all,

jON

You can't set a Label control to = Anything.
(A Label has a Caption property -- not a Control Source property --
that you can set using:
LableName.Caption = "Some text")

However if you just want to not show the label on the last page of the
report, just set it's Visible property to No.
LabelName.Visible = ([Page] = [Pages])

If you want to not show the ENTIRE detail section on the last page,
code the Detail Format event:
Cancel = ([Page] = [Pages])
 
The field was changed to a TextBox and then I used the code

=IIf([Page]=[Pages],"","Sales Executive")

in the Control Source property.

This was not working as expected but your suggestion to set the visible
property in the format section event doe sthe trick.

Thanks Fred.

jON

fredg said:
I have threee fields ...

a) Label with "Sales Exec"

b) Text Box for "Exec Code"

c) Text Box for "Exec Name"

b) and c) work with your logic but a) comes up blank regardless

so I think that [Page] and [Pages] logic must be working fine.

jON

Allen Browne said:
Do you have any code that is altering the Page or Pages of the report?

Add 2 more text boxes, with ControlSource:
=[Page]
and
=[Pages]
respectively. Can you see why Page and Pages are always equal?

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Strangely, a Text Box with a control source of

=IIf([Page]=[Pages],"","Sales Executive")

Instead of a Label always comes out blank??

jON

Put this expression into the ControlSource of a text box to show the
value of the CustomerCode on all but the last page:
=IIf([Page] = [Pages], Null, [CustomerCode])


Is it possible to change the contents of header for the last page of
a
report?

I want to remove the Customer code details as the last page is a
summary across the whole report and is printed on a page on its own.

I have tried setting the caption and visible properties in the report
footer event but they either throw up and error, change all
occurances
of the textbox or do nothing.

thanks all,

jON

You can't set a Label control to = Anything.
(A Label has a Caption property -- not a Control Source property --
that you can set using:
LableName.Caption = "Some text")

However if you just want to not show the label on the last page of the
report, just set it's Visible property to No.
LabelName.Visible = ([Page] = [Pages])

If you want to not show the ENTIRE detail section on the last page,
code the Detail Format event:
Cancel = ([Page] = [Pages])
 
Back
Top