Delete Wizard Not Working

S

Supe

I have a form that lists the employee information by using a drop down on the
Employee Name. I created a Delete Button from the wizard to delete whatever
name is selected from the drop down. When I hit the delete button, it does
not delete data. Code for delete button is below.

Private Sub cmdDelete_Click()
On Error GoTo Err_cmdDelete_Click


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

Exit_cmdDelete_Click:
Exit Sub

Err_cmdDelete_Click:
MsgBox Err.Description
Resume Exit_cmdDelete_Click

End Sub


Why is this not working?
 
M

Michel Walsh

The record may not be deleted from the table if you cannot delete it
manually, from the table view. That MAY occur due to Referential Data
Integrity rule, as example.

A deleted record in a table would not necessary refresh a combo box
RowSource, I mean, by that, that the list, under the listbox, may still
display a 'name' that belongs to the record we just deleted.


Hoping it may help,
Vanderghast, Access MVP
 

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

Similar Threads


Top