Hello,
On Form Load I get the data using the recordset
Private Sub Form_Load()
Dim rsErrors As DAO.Recordset
Set rsErrors = CurrentDb.OpenRecordset(" SELECT * FROM EMPLOYEES ")
--- code here to load the first record in the text box --
End Sub
Now to navigate the records, there is a Prev and Next button
This is the code for Next Click
Private Sub cmdNext_Click()
On Error GoTo Err_cmdNext_Click
Dim mvrs As Variant
Set mvrs = Me.subIndex.Form.RecordsetClone
mvrs.Bookmark = Me.subIndex.Form.Bookmark
mvrs.MoveNext
Me.subIndex.Form.Bookmark = mvrs.Bookmark
mvrs.Close
Set mvrs = Nothing
Exit_cmdNext_Click:
Exit Sub
Err_cmdNext_Click:
If Err.Number <> 3021 Then
MsgBox Err.Description
Resume Exit_cmdNext_Click
End If
End Sub
Getting an Invalid reference to the RecordsetClone property.
Could you please help me in Navigating Prev and Next records. If there is a better way please do let me know. Thanks
On Form Load I get the data using the recordset
Private Sub Form_Load()
Dim rsErrors As DAO.Recordset
Set rsErrors = CurrentDb.OpenRecordset(" SELECT * FROM EMPLOYEES ")
--- code here to load the first record in the text box --
End Sub
Now to navigate the records, there is a Prev and Next button
This is the code for Next Click
Private Sub cmdNext_Click()
On Error GoTo Err_cmdNext_Click
Dim mvrs As Variant
Set mvrs = Me.subIndex.Form.RecordsetClone
mvrs.Bookmark = Me.subIndex.Form.Bookmark
mvrs.MoveNext
Me.subIndex.Form.Bookmark = mvrs.Bookmark
mvrs.Close
Set mvrs = Nothing
Exit_cmdNext_Click:
Exit Sub
Err_cmdNext_Click:
If Err.Number <> 3021 Then
MsgBox Err.Description
Resume Exit_cmdNext_Click
End If
End Sub
Getting an Invalid reference to the RecordsetClone property.
Could you please help me in Navigating Prev and Next records. If there is a better way please do let me know. Thanks