J
Jason
I'm running the code below for a command button that does record navigation.
The problem I have is that when I open the form, it thinks there is only one
record, so it moves to the Else portion of the code. I've tried doing a
movelast, movefirst so it has an accurate record count, but then the first
time I click the button it runs the first part of the If statement but
doesn't move to the next record!
Any help would be appreciated.
Private Sub cmdNextRecord_Click()
On Error GoTo Err_cmdNext_Click
If Me.CurrentRecord < Me.Recordset.RecordCount Then
Me.Recordset.MoveNext
Else
DoCmd.OpenForm "frmGrade"
End If
Exit_cmdNext_Click:
Exit Sub
Err_cmdNext_Click:
MsgBox Err.Description
Resume Exit_cmdNext_Click
End Sub
The problem I have is that when I open the form, it thinks there is only one
record, so it moves to the Else portion of the code. I've tried doing a
movelast, movefirst so it has an accurate record count, but then the first
time I click the button it runs the first part of the If statement but
doesn't move to the next record!
Any help would be appreciated.
Private Sub cmdNextRecord_Click()
On Error GoTo Err_cmdNext_Click
If Me.CurrentRecord < Me.Recordset.RecordCount Then
Me.Recordset.MoveNext
Else
DoCmd.OpenForm "frmGrade"
End If
Exit_cmdNext_Click:
Exit Sub
Err_cmdNext_Click:
MsgBox Err.Description
Resume Exit_cmdNext_Click
End Sub