Delete button not "deleting" ???

  • Thread starter Thread starter Ryan
  • Start date Start date
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.
 
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
 
OK new problem emerged. it deletes it from the form but not from the table
from which the form draws data from?
 
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.
 
Back
Top