Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Jul 2008
    Location
    Suffolk, United Kingdom
    Posts
    308
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Move next or previous by 10 (2003)

    Hi,

    I would like to be able to move forward or backward through a datasheet by 10 records at a time. I have two buttons on my form labeled cmbForward10 and CmdBack10

    Many thanks
    Regards
    Gerbil (AKA Kevin)

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Move next or previous by 10 (2003)

    Try this:
    <code>
    Private Sub cmbForward10_Click()
    On Error GoTo ErrHandler
    DoCmd.GoToRecord Record:=acNext, Offset:=10
    Exit Sub
    ErrHandler:
    If Err = 2105 Then
    DoCmd.GoToRecord Record:=acLast
    End If
    End Sub

    Private Sub CmdBack10_Click()
    On Error GoTo ErrHandler
    DoCmd.GoToRecord Record:=acPrevious, Offset:=10
    Exit Sub
    ErrHandler:
    If Err = 2105 Then
    DoCmd.GoToRecord Record:=acFirst
    End If
    End Sub</code>

  3. #3
    3 Star Lounger
    Join Date
    Jul 2008
    Location
    Suffolk, United Kingdom
    Posts
    308
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Move next or previous by 10 (2003)

    Thanks again Hans. works great
    Regards
    Gerbil (AKA Kevin)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •