We just migrated from access 2003 to access 2007 version. The form that was working fine in access 2003 is now giving Run time error 3021: No current record when doing a rs.movelast.
The form opens a new record. After we enter a record and go back to the form again, when it is supposed to load the last record in the table, I am getting the run time error 3021.
Code is as follows
Dim rst As Recordset
Set rst = Me.RecordsetClone
If [Forms]![S1]![HHTxt] = 0 Then
DoCmd.GoToRecord , , acNewRec
Else
Forms!A1.RecordsetClone.MoveLast
Me.Bookmark = rst.Bookmark
End If
The value for HHTxt is set to 0 or 1 in the dblclick event of the S1 form. The A1 form is opened with acFormEdit.
What could be different in access 2007? Did somebody have the same issue? Please let me know
Thanks
The form opens a new record. After we enter a record and go back to the form again, when it is supposed to load the last record in the table, I am getting the run time error 3021.
Code is as follows
Dim rst As Recordset
Set rst = Me.RecordsetClone
If [Forms]![S1]![HHTxt] = 0 Then
DoCmd.GoToRecord , , acNewRec
Else
Forms!A1.RecordsetClone.MoveLast
Me.Bookmark = rst.Bookmark
End If
The value for HHTxt is set to 0 or 1 in the dblclick event of the S1 form. The A1 form is opened with acFormEdit.
What could be different in access 2007? Did somebody have the same issue? Please let me know
Thanks