Results 1 to 9 of 9
  1. #1
    dccjr3927 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2019
    Posts
    130

    Report only opens for First Record

    I have a report that only opens with the first page(record). Any ideas?

    Code:
    Private Sub cmdPrintWO_Click()
    Dim strLenPrintOrderSQL As String
        strLenPrintOrderSQL = "SELECT * FROM LenoxOrdersPrint"
        DoCmd.OpenReport "LenoxWO", acViewPreview, strLenPrintOrderSQL
    End Sub


  2. #2
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    First try removing the Filter argument, i.e.
    Code:
        DoCmd.OpenReport "LenoxWO", acViewPreview
    If that doesn't work, then notice the following.
    It looks like "acViewPreview" is opening the report in Print Preview mode.
    Maybe try "acViewNormal" or "acViewReport" instead (see: https://docs.microsoft.com/en-us/off.../access.acview)

  3. #3
    dccjr3927 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2019
    Posts
    130
    Thanks for the suggestions, but nothing changed. Still only get the first record.

  4. #4
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    If you open the "LenoxWO" report manually by clicking on it, do you see more than one record?

    If so, then I think this should work:
    Code:
    Private Sub cmdPrintWO_Click()
        DoCmd.OpenReport "LenoxWO", acViewReport
    End Sub

  5. #5
    dccjr3927 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2019
    Posts
    130
    If I open it manually (in any view) it still only opens one record. There are 29 records in the table.

  6. #6
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    If I open it manually (in any view) it still only opens one record. There are 29 records in the table.
    If you open it manually, and it only shows one record, then the problem has nothing to do with the VBA code, it is with the Report itself.
    My guess is that the Record Source of your Report is NOT your table, but rather a filtered Query.
    If you open the Report in Desgin View and take a look at its Properties, what does it show as being the Record Source for the Report?

  7. #7
    dccjr3927 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2019
    Posts
    130
    [LenoxOrdersPrint]. This is correct.

  8. #8
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    [LenoxOrdersPrint]. This is correct.
    Hmmm....
    Not sure you are looking in the right place. Typically, you wouldn't see any brackets or periods in a Table name. Is that really the name of your table?
    Any chance you can upload your database for analysis?

  9. #9
    dccjr3927 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2019
    Posts
    130
    Sorry, it is habit to type it in bracket in correspondence. The name does not have the brackets in the Record Source property. I will have to make a copy and strip the data from it. It has customer information in it.

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

Similar Threads

  1. Replies: 4
    Last Post: 12-16-2014, 05:08 PM
  2. Replies: 15
    Last Post: 07-24-2014, 09:45 AM
  3. Form always opens to new record
    By gemadan96 in forum Forms
    Replies: 1
    Last Post: 07-22-2014, 06:17 AM
  4. Report Opens Faster on 2nd try
    By gg80 in forum Access
    Replies: 2
    Last Post: 12-29-2012, 09:18 PM
  5. Clicking on label opens up new record
    By swimmermx in forum Forms
    Replies: 2
    Last Post: 07-20-2010, 03:58 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