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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top