Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run time error 3021 in Access 2007

Status
Not open for further replies.

chunchun

Programmer
Apr 10, 2009
12
US
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top