Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old November 9th, 2004, 05:12 PM
Authorized User
 
Join Date: Jun 2003
Location: Irvine, CA, USA.
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
Reply With Quote
  #2 (permalink)  
Old November 10th, 2004, 11:23 AM
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
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
Reply With Quote
  #3 (permalink)  
Old November 10th, 2004, 12:44 PM
Authorized User
 
Join Date: Jun 2003
Location: Irvine, CA, USA.
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
Reply With Quote
  #4 (permalink)  
Old November 11th, 2004, 06:33 AM
Authorized User
 
Join Date: Jul 2003
Location: Stockton on Tees, , United Kingdom.
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
Reply With Quote
  #5 (permalink)  
Old November 11th, 2004, 11:07 AM
Authorized User
 
Join Date: Jun 2003
Location: Irvine, CA, USA.
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
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 09:38 AM
Printing PDF (page x to y) / multiple page seq's robbert XSLT 1 November 13th, 2006 09: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 12:45 PM



All times are GMT -4. The time now is 10:06 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.