I'm using Access 2002 and after exporting all my working forms, queries, macros and spitting off the database to get rid of one errant vba class object, I now get
Error 3021: No current record
when I use a delete button on a a form that existed before the above transformation. It also errors when I use a delete button created after the transformation. Both delete functions complete successfully before the alarm and when I use debug it points to the "DoCmd.RunCommand acCmdDeleteRecord" statement.
Here is the code.
Private Sub StudentDelete_Click()
On Error GoTo Err_StudentDelete_Click
DoCmd.SetWarnings False
DoCmd.RunCommand acCmdDeleteRecord
Me.Refresh
DoCmd.SetWarnings True
Exit_StudentDelete_Click:
Exit Sub
Err_StudentDelete_Click:
If Err = 3021 Then 'No current record
MsgBox "Deletion Successful"
Exit Sub
Else
MsgBox Err.Description
Resume Exit_StudentDelete_Click
End If
End Sub
Any help would greatly appreciated
Error 3021: No current record
when I use a delete button on a a form that existed before the above transformation. It also errors when I use a delete button created after the transformation. Both delete functions complete successfully before the alarm and when I use debug it points to the "DoCmd.RunCommand acCmdDeleteRecord" statement.
Here is the code.
Private Sub StudentDelete_Click()
On Error GoTo Err_StudentDelete_Click
DoCmd.SetWarnings False
DoCmd.RunCommand acCmdDeleteRecord
Me.Refresh
DoCmd.SetWarnings True
Exit_StudentDelete_Click:
Exit Sub
Err_StudentDelete_Click:
If Err = 3021 Then 'No current record
MsgBox "Deletion Successful"
Exit Sub
Else
MsgBox Err.Description
Resume Exit_StudentDelete_Click
End If
End Sub
Any help would greatly appreciated