Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2009
    Posts
    85

    Unanswered: Navigtion buttons

    Hello. I have been asked to put navigation buttons on a bound form, so users can find previous entries, have used wizard. under lying table has only one index field(Primary key auto number). Records go from 1-1551, "first" button go's to record 145 and can not move past that even with "previous" button. "Last" button gets me to last record 1551 but "previous" button jumps back 50 records to 1501, the "next" button moves back to last record again. I am befuddled as to this behavior have tired for the last hour to figure out problem, no luck, insight is appreciated. Thanks

  2. #2
    Join Date
    Mar 2009
    Location
    Dorset
    Posts
    119
    Hi,
    Could you post the code that is attached to the buttons. This may give some indication on what's going on.
    Regards
    JD

    Software-Matters

  3. #3
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Besides showing us the code, how are the records sorted? On the autonumber field or on another field?
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  4. #4
    Join Date
    Apr 2009
    Posts
    85
    Hello SoftwareMatters and Missingling, thanks for responding, records are sorted on autonumber, no other indexed fields. I have tried these coding methods

    Private Sub cmdFirst_Click()
    If Me.Recordset.RecordCount <> 0 Then
    If Me.CurrentRecord <> 1 Then Me.Recordset.MoveFirst
    End If

    End Sub

    And

    Private Sub cmdprevious_Click()

    If Me.Recordset.RecordCount <> 0 Then
    If Me.CurrentRecord > 1 Then Me.Recordset.MovePrevious
    End If
    Exit Sub

    End Sub

    As Well as

    Private Sub cmdFirst_Click()
    On Error GoTo Err_cmdfirst_Click


    DoCmd.GoToRecord , , acFirst

    Exit_cmdfirst_Click:
    Exit Sub

    Err_cmdfirst_Click:
    MsgBox Err.Description
    Resume Exit_cmdfirst_Click

    End Sub

    and

    Private Sub cmdprevious_Click()
    On Error GoTo Err_cmdprevious_Click

    Me.txtChairBuildDetailsID.SetFocus

    DoCmd.GoToRecord , , acPrevious

    Exit_cmdprevious_Click:
    Exit Sub

    Err_cmdprevious_Click:
    MsgBox Err.Description
    Resume Exit_cmdprevious_Click

    End Sub

    Have Next and Last as well

  5. #5
    Join Date
    Apr 2009
    Posts
    85
    Turns out I was not sorting on the autonumber field in the query my form was based on, thank SoftwareMatters and Missingling for jumping in in on this

  6. #6
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    That's what I figured, hence the question about what field you were sorting on. Glad you got it fixed.
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Posting Permissions

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