Results 1 to 4 of 4
  1. #1
    liamfrancis2013 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2015
    Posts
    7

    Printing a Report from a button using Code Builder

    I want to print my Report by using Code Builder, from a button, i want this report to fit to one page and be landscape. Anyone know the code for this?



    Currently on my button i have the code:

    Private Sub Command25_Click()
    DoCmd.PrintOut
    End Sub

    This obviously just prints it landscape and across multiple pages.

    Thanks,

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    Turn on the wizard, then drop a button on the form,
    the wizard will ask you...
    select rreport.
    select which report.
    select printer, or preview.

    but the code is...
    docmd.openreport "rMyRpt", acpreview

  3. #3
    liamfrancis2013 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2015
    Posts
    7
    Thanks them solutions were brilliant, i did end up using the code though because my buttons are on my report, and the control wizard didn't work on them

  4. #4
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    you must turn on the wizard. it does work.

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

Similar Threads

  1. Replies: 5
    Last Post: 01-09-2015, 03:58 PM
  2. Replies: 3
    Last Post: 10-20-2014, 03:25 PM
  3. Printing report setup button not working
    By data808 in forum Access
    Replies: 10
    Last Post: 08-12-2014, 12:05 PM
  4. Macro Builder and Code Builder
    By data808 in forum Macros
    Replies: 2
    Last Post: 01-12-2014, 11:28 AM
  5. Replies: 3
    Last Post: 10-19-2011, 01:05 PM

Tags for this Thread

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