Results 1 to 12 of 12
  1. #1
    cactuspete13 is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Dec 2012
    Posts
    53

    Display XX number of records per page

    I am building a small database for home use to track what movies and TV shows I have. I'm trying to make a continuous forms form that will show xx number (10-20) per page, let's say 15 for example. I'm still entering my movies into the list and I'm already over 300 movies, so having to scroll up and down is a pain. I've already built functions to sort and filter the whole list, but I'm trying to limit how many show up at a time. This is partly to make it easier to find movies but also that I like a challenge.

  2. #2
    NTC is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2009
    Posts
    2,392
    a continuous form is continuous. no way around that.

    you would need to move to a report....

  3. #3
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    I don't know that it's possible to create breaks in continuous forms which is what you're asking for.

    Personally I wouldn't do a number of items per page, I'd set the whole form up as a search.

    I should think you'd be far better off typing in a partial string and search movie titles or actors or directors for the information then displaying only the relevant results.

  4. #4
    amrut is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Location
    Dubai
    Posts
    614
    You can use the following code using two buttons
    Button to PageUp -
    Code:
    If Me.CurrentRecord < 25 Then
            DoCmd.GoToRecord , , acFirst
        Else
            DoCmd.GoToRecord , , acPrevious, 20
        End If
    Endif
    Button to PageDown -
    Code:
    If Me.CurrentRecord + 20 > Me.Recordset.RecordCount Then
            DoCmd.GoToRecord , , acLast
        Else
            DoCmd.GoToRecord , , acNext, 20
        End If

  5. #5
    Missinglinq's Avatar
    Missinglinq is online now VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    An extra EndIf crept into that first bit of code:
    Code:
    If Me.CurrentRecord < 25 Then
            DoCmd.GoToRecord , , acFirst
        Else
            DoCmd.GoToRecord , , acPrevious, 20
        End If
    Endif
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  6. #6
    cactuspete13 is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Dec 2012
    Posts
    53
    Amrut: That code works perfectly, except it is shifting through 20 at a time and I'm shooting for 15 at a time. I tried adjusting the code but got lost a little. I was able to adjust the page up numbers to 25 and 15, and it works perfectly. When I tried to update the page down, numbers to 20 and 15, nothing happens when I first click on that button nothing happens, then it jumps to record 30. That pattern continues, click once and nothing happens, click again and it jumps 30 records.

    I've tried sitting here with Visual Basic open and plugging in different numbers. I was able to get the previous page (page up) to work using 25 and 15, but I'm having problems with the next page (page down). I've run every combination for those two using 10, 15, 20, and 25, (for the first value I even tried 5 and 0, I just changed it to read Me.CurrentRecord > Me.Recordset.RecordCount). All I'm getting is shifting 20, 25 or 30, and either single click or having to click twice.
    Last edited by cactuspete13; 07-17-2014 at 01:19 AM.

  7. #7
    amrut is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Location
    Dubai
    Posts
    614
    The form I used displayed 25 records hence I used 25 and 20. I have tried with all numbers changed to 15, and it is working.
    Code:
    If Me.CurrentRecord < 15 Then
            DoCmd.GoToRecord , , acFirst
        Else
            DoCmd.GoToRecord , , acPrevious, 15
        End If
    Code:
    If Me.CurrentRecord + 15 > Me.Recordset.RecordCount Then
            DoCmd.GoToRecord , , acLast
        Else
            DoCmd.GoToRecord , , acNext, 15
        End If

  8. #8
    cactuspete13 is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Dec 2012
    Posts
    53
    Let me remove everything that you won't need and I will send you a copy of this so you can take a look.

  9. #9
    cactuspete13 is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Dec 2012
    Posts
    53
    Database1.accdb

    Attached is a dumbed down copy of the database. Trying to get the coding found on two buttons in the MovieListSubFormAll form to scroll through 15 at a time. I left 60 records in there for you to experiment with. Thanks for the assist

  10. #10
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows 7 32bit Access 2007
    Join Date
    Mar 2012
    Posts
    528
    Hi cactuspete13
    Prefer
    And give your opinion
    Attached Files Attached Files

  11. #11
    cactuspete13 is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Dec 2012
    Posts
    53
    Works like a charm, thanks. I'm going to spend the next week or two figuring out how it works, but it works, thanks. I'm guessing that as long as I have the "RowNum([Form])" column on the form, it will work on multiple forms? I'm still pretty new when it comes to working with vba.

  12. #12
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows 7 32bit Access 2007
    Join Date
    Mar 2012
    Posts
    528
    Very good I am very happy to help you

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

Similar Threads

  1. Display and print group records in one page only?
    By wittybrent in forum Reports
    Replies: 1
    Last Post: 05-11-2013, 09:25 AM
  2. Replies: 1
    Last Post: 11-21-2012, 08:18 AM
  3. Replies: 6
    Last Post: 07-25-2011, 01:54 PM
  4. report does not display in 1 page
    By ngeng4 in forum Reports
    Replies: 4
    Last Post: 03-18-2010, 08:26 AM
  5. Replies: 1
    Last Post: 03-12-2009, 09:55 AM

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