Results 1 to 3 of 3
  1. #1
    Jen0dorf is offline Competent Performer
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    UK
    Posts
    453

    print report error

    Hi

    I have created a report based on a query. The query shows one specific record out of 1000sss

    My code is below but I've missed something as it attempts to print out all records - 39000

    I suspect the error is in the line accPagesAll but deleting it makes no difference

    Code:
    Private Sub btnPrintBansReport_Click()
    DoCmd.OpenReport "rpt_Banns", , , "BannsId = " & Me.BannsId
    DoCmd.PrintOut acPagesAll
    End Sub
    thanks

    Ian

  2. #2
    apr pillai's Avatar
    apr pillai is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2010
    Location
    Alappuzha, India
    Posts
    209
    If the Report's Record Source Query result is only one record then there is no point in adding the criteria part of the DoCmd.OpenReport command.

    Code:
    Private Sub btnPrintBansReport_Click()
    DoCmd.OpenReport "rpt_Banns",acViewNormal
    End Sub

  3. #3
    Jen0dorf is offline Competent Performer
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    UK
    Posts
    453
    Hi

    point taken

    thanks a lot

    Ian

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

Similar Threads

  1. Replies: 5
    Last Post: 08-06-2015, 03:26 PM
  2. Replies: 1
    Last Post: 02-21-2015, 11:35 PM
  3. Replies: 6
    Last Post: 03-01-2014, 07:07 AM
  4. Replies: 0
    Last Post: 02-22-2011, 05:04 AM
  5. Error in Print Report Button
    By Robert M in forum Reports
    Replies: 16
    Last Post: 09-23-2009, 03:08 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