Delete button not "deleting" ???

R

Ryan

I have a delete button on my form to delete a record but when the are you
sure you want to delete yes no box appears nothing happens when "yes" is
pushed. Here is my code:

Private Sub DeleteRecord_Click()
If MsgBox("Confirm delete", vbYesNo) = vbYes Then
'add delete code
Else
Exit Sub
End If

End Sub

What am I missing? Thx.
 
B

BruceM

There is no code to perform the deletion. The "add delete code" line was
meant to be replaced by something such as:
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdDeleteRecord
 
R

Ryan

OK new problem emerged. it deletes it from the form but not from the table
from which the form draws data from?
 
B

BruceM

Not sure what's going on, and I will be away from a computer for several
days, but be sure the table is in the form's record source, and that you are
at the record that needs to be deleted when you run the code.
 

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