Surpressing blank page

Posted on 2006-06-07
Last Modified: 2012-05-05
Hi All,
A new clients database (built by another and not very well but, its what I have to work with) has bound forms that display customer information and when printed, is three pages long. The information on page 3 is set to screen display only. When printing it prints 3 pages with the last
page being a blank page. I have tried to surpress the third page by putting a print button on the form and adding the vba code -
Docmd.Printout acPages, 1, 2 which does Not work.

The Docmd.Printout acPages, 1, 2  actually prints page 1 and 2 of record 1, not the currently displayed records, which I don't understand. Again, the form is a bound form and so the user uses the record selector to go to the record of choice and then wants page 1 and 2 of the displayed record printed.

I have tried several things and can't seem to find the right
combination to get it working correctly, I've tried such things like
Docmd.Printout acPages, 1, 2  'prints page 1 and 2 of record 1 not currently displayed record

Docmd.Printout acPages, 1, 2  'prints page 1 and 2 of record 1 not currently displayed record

DoCmd.RunCommand acCmdSelectRecord
DoCmd.PrintOut acSelection  'still prints third page which is blank

DoCmd.RunCommand acCmdSelectRecord
Docmd.Printout acPages, 1, 2  'prints page 1 and 2 of record 1 not currently displayed record

So, how do I get Only page 1 and 2 of the current record that's being displayed on the screen printed??? Creating reports for these forms is not an option, there are 10 of these forms with many, many controls on them and I don't think this client would want to pay for the creation of 10 reports just to surpress the printing of a blank page.


Question by:bhynes
    LVL 44

    Expert Comment

    when the screen is printed, you essentially have no further control over how many 'pages' are going to be actually printed.  What you are asking is not possible.  The DoCmd.PrintOut command  is used to print reports, and does not affect what happens with PrintScreen.  If you want to be able to provide the client with Printed ouptput, the best approach is to design a REPORT to print the formatted data, and NOT to use PrintScreen.

    LVL 58

    Accepted Solution

    Hello bhynes

    Although forms do not have all features of reports, they have some. For example, there is the "dispay when property", but there are also page headers and footers, page breaks and the CanGrow and CanShrink properties, along with ForNewPage, NewRowOrCol, KeepTogether for sections.

    When a control with DisplayWhen:Screen is printed, it is essentially hidden. If it also has CanShrink:Yes, the controls below will move up to occupy that space. Finally, if the section has CanShrink:Yes, it will, well, shrink by the ammount of all hidden, not printed, or Null controls, having that same setting.

    Using that, I'm certain that you will be able to reclaim the wasted space and shrink the printed ouptut to two pages.

    > I don't think this client would want to pay for the creation of 10 reports

    That would be what, one hour? Breaks down to:
    * select form, choose "file / save as", As: Report (5 seconds)
    * adjust the two or three properties or event events handlers not available for forms (5 minutes)
    * repeat 10 times (51 minutes.)

    OK, you will want to use another hour to add "print" buttons to your forms and the like, but my point is that a report doing exactly what the printing of a form does takes 5 seconds to create.

    Hope this gets you out of the woods!


    Author Comment

    I have the controls that show on what would be page3 set to screen only but what I didn't think about was 'CanShrink' so, I'll play around with that in combination with all the other tweaks and adjustments I've done.
    LVL 58

    Expert Comment

    Glad to help, success with your client!

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    The first two articles in this short series — Using a Criteria Form to Filter Records ( and Building a Custom Filter ( — discuss in some detail how a form can be…
    QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
    Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
    With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

    730 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now