Results 1 to 3 of 3
  1. #1
    eddcole is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Dec 2016
    Posts
    5

    Must be an easy way

    Hi There,



    I have a two page form, if I do not fill any info in on page two then it does not need to print. Is there an easy way to stop it printing other that only selecting page one once I'm in the print option? I have considered hiding the page unless a check box is checked but that would mean hiding every individual element in a massive code.

    Any ideas guys

  2. #2
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,474
    You should really print from reports, not forms but this might work on a button. You should check values in fields to see if page 2 is needed.


    Dim MyForm As Form
    Set MyForm = Screen.ActiveForm
    DoCmd.SelectObject acForm, MyForm.Name, True
    If isnull(me.Page2Fielda) and isnull(me.Page2Fieldb) then
    DoCmd.PrintOut acPages, 1, 1 'Print only page 1
    Else
    DoCmd.PrintOut 'Print all pages
    End If
    DoCmd.SelectObject acForm, MyForm.Name, False

  3. #3
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,428
    forms are not really intended for printing, but you could look at having some code which checks if data has been completed on page 2 and if not changes all the controls on that page 'display when' property to Screen Only. Chances are it will still print a blank page though.

    Another option would be to reduced the height of all controls to 0, move their top position to top of page then change the detail height to ensure it only prints one page - then put it all back again for the next record.

    Or perhaps put all of page 2 into a subform, in which case you would only need to change the height and reposition one control.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Easy Question
    By BenjaminDz in forum Access
    Replies: 13
    Last Post: 05-06-2015, 02:58 PM
  2. I Bet this is an EASY Fix!!!
    By Z1nkstar in forum Access
    Replies: 10
    Last Post: 06-06-2014, 10:32 AM
  3. Replies: 0
    Last Post: 03-29-2011, 09:37 AM
  4. Easy question
    By Danzig in forum Access
    Replies: 11
    Last Post: 10-28-2010, 06:48 PM
  5. I know this has to be easy...
    By MelindaP in forum Access
    Replies: 7
    Last Post: 08-20-2010, 02:15 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums