Hi There,
I get this error when I delete more than one record consecutively.
Here is my delete code;
Thank You...
I get this error when I delete more than one record consecutively.
Here is my delete code;
Code:
Private Sub Komut98_Click()
Dim blnLast As Boolean
'MsgBox call must return the value in order to be checked.
'If user says no then cancelling is not required. It is only required
' that the deletion command is not invoked.
If MsgBox(Prompt:="Bu kaydı silmek istediğinizden eminmisiniz?" _
, Buttons:=vbYesNo Or vbQuestion _
, Title:="Deleting Record") = vbNo Then Exit Sub
'At this point it's clear we need to delete the record.
'Using With Me is a more efficient approach to object usage.
With Me
'Remember for later if record is last.
blnLast = (.CurrentRecord = .Recordset.RecordCount)
Call .Recordset.Delete
'Only step back if deleted record was the last.
If blnLast Then Call DoCmd.GoToRecord(Record:=acPrevious)
End With
End Sub