Delete problem

saif009972

Registered User.
Local time
Today, 06:05
Joined
Jan 15, 2008
Messages
26
Dear all ..I am facing a problem most often when I try to delete a record. Sometimes it works well ie Delete record and sometimes it does not and message box come up showing "No current Record". For better clarification I am giving the code below.

Private Sub Command25_Click()
On Error GoTo Err_Command25_Click

If MsgBox("Sure to Delete", vbYesNo + vbDefaultButton2, "Delete confirmation") = vbYes Then

Me.Recordset.Delete
Me.Recordset.MoveFirst

End If

Why it behaves diffently?
 
One guess would be that the delete takes the only remaining record from the recordset, so the MoveFirst would error.
 

Users who are viewing this thread

Back
Top Bottom