Data is deleted from Query but not in Tables..

  • Thread starter Thread starter Newf via AccessMonster.com
  • Start date Start date
N

Newf via AccessMonster.com

I am having a problem with DELETING files from the tables. I have the code:
Private Sub frm_cmd_Delete_Click()
On Error GoTo Err_frm_cmd_Delete_Click


DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70

Exit_frm_cmd_Delete_Click:
Exit Sub

Err_frm_cmd_Delete_Click:
MsgBox Err.Description
Resume Exit_frm_cmd_Delete_Click

Is there more code I can place in there so the records get deleted from the
table as well as the query??

Newf
 
Tables don't have files; however they do have fields. Are you trying to
delete fields from the table or records?

Either which way, the old DoMenuItem was always a little buggy and should be
replaced with DoCmd.RunCommand. Something like below should work if you want
to delete the record that you are currently in on the form.

DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdDeleteRecord
DoCmd.RunCommand acCmdSave

Actually the last line shouldn't be needed. If that doesn't delete the
record, something else is going on.
 
Back
Top