Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2019
    Posts
    11

    Loop records when manually tabbing through a subform

    I have a subform that holds additional data about a department, with command buttons to cycle forward and backwards to see more data. When the user clicks through to the end of the data, if they click the next command button again, a pop up opens that says "You can't go to the specified record." Is there a way to change the subform, so that it loops back to the beginning again?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    the record controlers (at the bottom) already do this:
    << : 1st record
    < : previous record
    > : next record
    >> : last record
    * : new record

  3. #3
    Join Date
    Feb 2019
    Posts
    11
    ranman, yes, I do see that as an option, but with my end users we are looking for a larger, easier to use button. Thanks

  4. #4
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,740
    See if you can adapt this...

    Code:
    Private Sub cmdNext_Click()
        On Error GoTo cmdNext_Click_Error
        DoCmd.GoToRecord , "", acNext
    cmdNext_Click_EXIT:
        Exit Sub
    cmdNext_Click_Error:
        Select Case Err
            Case 2105
                DoCmd.GoToRecord , , acFirst
                Resume Next
            Case Else
                MsgBox Err.Number & ", " & Err.Description
        End Select
        Resume cmdNext_Click_EXIT
    End Sub

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

Similar Threads

  1. Replies: 1
    Last Post: 03-21-2016, 10:40 AM
  2. How to update subform records using loop
    By tahirsatti in forum Forms
    Replies: 15
    Last Post: 05-13-2013, 01:22 AM
  3. Replies: 1
    Last Post: 11-21-2012, 03:41 PM
  4. Replies: 4
    Last Post: 04-07-2011, 03:39 PM
  5. Loop through subform records
    By asmith in forum Forms
    Replies: 6
    Last Post: 10-06-2010, 10:31 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