Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 9th, 2004, 06:12 PM
Authorized User
 
Join Date: Jun 2003
Posts: 75
Thanks: 0
Thanked 0 Times in 0 Posts
Default Page Header Printing on Last Empty Page

Hi.

I have a very busy form with lots of detail on it and a couple of subforms. The last subform is based on rows in another table. If there are no rows in the last subform I set the Visible property of that subform (and 2 labels and textbox that go along with it) to False. This prevents the associated labels and textbox from printing. BTW, the subform did not print if there were no rows in it but I still set the Visible property to False.

All the information prints easily on 1 page when the last subform and 2 labels and textbox are not printed. I set the Visible property to False in the Detail Format Event.

However, I'm still getting a second page with just the Page Header on it. I've tried several things to get that last page to not print but to no avail. What's interesting is that the Intellisense does not show the Visible property but it does hide the objects when I set them to Invisible.

Here's my code from the Report:
Private Sub Detail1_Format(Cancel As Integer, FormatCount As Integer)
    If IsNull(Me.txtBaseSCRID) Then
        Me.lblPhaseX.Visible = False
        Me.lblBaseSCRID.Visible = False
        Me.txtBaseSCRID.Visible = False
        Me.SubFrmSCR_Links.Visible = False
    Else
        Me.lblPhaseX.Visible = True
        Me.lblBaseSCRID.Visible = True
        Me.txtBaseSCRID.Visible = True
        Me.SubFrmSCR_Links.Visible = True
    End If
End Sub

Any suggestions will be greatly appreciated.
Thanks.

Rita
 
Old November 10th, 2004, 12:23 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Try putting any code that handles controls in the header section into the HEADER's ON FORMAT event code instead of the detail section.


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
 
Old November 10th, 2004, 01:44 PM
Authorized User
 
Join Date: Jun 2003
Posts: 75
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Greg,

Thanks for the suggestion. I moved the code from the Detail section to the Header section and played around with the FormatCount but I'm still getting that last page.

Rita
 
Old November 11th, 2004, 07:33 AM
Authorized User
 
Join Date: Jul 2003
Posts: 73
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Just a thought, have you checked that the subforms have the property 'Can shrink' set?

Cheers Ray
 
Old November 11th, 2004, 12:07 PM
Authorized User
 
Join Date: Jun 2003
Posts: 75
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Ray,

Thanks for the suggestion. I really thought it would work but after setting all the different section's "Can Shrink" on the SubForm to Yes I'm still getting the same results.

Rita





Similar Threads
Thread Thread Starter Forum Replies Last Post
Printed Page Header Navy1991_1 XSLT 8 July 18th, 2008 11:46 AM
Empty Pages on "New Page Before" EMS Crystal Reports 0 November 16th, 2006 10:38 AM
Printing PDF (page x to y) / multiple page seq's robbert XSLT 1 November 13th, 2006 10:27 AM
Page Header chacquard Access VBA 1 September 26th, 2005 06:17 PM
Page Header JohnBoyUK BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 1 November 23rd, 2004 01:45 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.