Delete Wizard Not Working

G

Guest

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

Jet Engine Error Message 2
Wizard's delete command 5
Can't delete record 6
Filtered records 3
delete record 3
I'd like my delete warning back. I don't know where it went. 15
Variable not defined 1
delete records 1

Top