Delete Record

K

ken

I have a form that creates new OrderNum and Order information
from users

When they are done entering info I have 2 cmd buttons
Save and Delete

cmd save works fine
But cmdDelete still shows record in Orders Table

This is what I am using now
Private Sub cmdDelete_Click()


' Undo any changes to the current record.
If Me.Dirty Then
Me.Undo
End If


' If this isn't a new record, delete it.
If Not Me.NewRecord Then
RunCommand acCmdDeleteRecord
End If
DoCmd.Close

End Sub
Thanks for any suggestions
Ken
 
V

Van T. Dinh

Try:

DoCmd.RunCommand acCmdDeleteRecord

Is it on a single Form and not a Form / Subform combination?

Have you traced the code and see if the execution gets to the delete
statement?
 
Top