acEditMenu help

K

Ken

I'm giving the users of my Access 2000 database the ability to delete records
via a command button having the following code behind it:

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

Question: I'd like to be able to log some information to a logfile in the
event the user does delete the record. I know how to write to the logfile.
What I need help on is something along the lines of, "If command 6 is carried
out, then..."

Any suggestions?
 
G

Graham Mandeno

Hi Ken

First, don't use these DoMenuItem commands. They are generated by wizard
code that has not been updated since Access 95 and they are obsolete.
Instead, use this single line:

DoCmd.RunCommand acCmdDeleteRecord

If you want to execute some code after the delete has happened, you can just
put the code right after the delete command.

If you want to also catch other methods of deleting a record (for example,
the toolbar button) then put the code in the form's AfterDelConfirm event
procedure.
 

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

Top