DoMenuItem

  • Thread starter Thread starter Dan
  • Start date Start date
D

Dan

Hi;

I'll try this again. I asked this question a couple of
weeks ago, but I think I asked it wrong.

When I cancel a record (row) delete action from any form
in my project, I get the message "The DoMenuItem action
was cancelled".

I'm new to Access but I think this error message probably
has a error number associated with it, and a way to trap
the error at the project level (globally) and change the
message to something meaningful to a user, like "Delete
Cancelled". :)

Can someone point me in the right direction, right now
I'm clueless.

Thanks,
Dan
 
it is not clear at all when, where, and how your delete code works.

However, I think best approach is simply to roll your own code.

You could place the following code in your form, and then call it from a
button, or your menu bar.


Private Sub Command40_Click()

If MsgBox("Delete this reocrd?", vbQuestion + vbYesNo, _
"Delete?") = vbYes Then

CurrentDb.Execute "delete * from main where id = " & Me!ID
Me.Refresh

End If
End Sub

Just replace "id" with whatever you used at the key id for the record in the
form.
 
Back
Top