Results 1 to 2 of 2
  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Virginia, USA
    Posts
    1,560
    Thanks
    37
    Thanked 1 Time in 1 Post

    Scrolling with command buttons (2003)

    I like to use command buttons on my forms to allow going to the next or previous record. The navigation buttons property is set to No. The only thing I miss is the ability to click and hold an arrow to move rapidly through records. I have to click repeatedly on the command button to move quickly. Is there code I can add behind the command buttons to permit rapid scrolling through records?

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

    Re: Scrolling with command buttons (2003)

    One possibility is to set the AutoRepeat property of the command buttons to Yes, and to use the On Mouse Down and On Mouse Up events instead of the On Click event of the buttons. The following example is for the "next record" button:

    Private blnMouseDown As Boolean

    Private Sub cmdNextRecord_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    On Error GoTo ErrHandler
    blnMouseDown = True
    Do While blnMouseDown
    RunCommand acCmdRecordsGoToNext
    Loop
    ErrHandler:
    End Sub

    Private Sub cmdNextRecord_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    blnMouseDown = False
    End Sub

    Another possibility is to use a subform for the custom navigation buttons - see RecordNavButtons on Stephen Lebans' website.

Posting Permissions

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