Default Delete Button Code not working?

Cosmos75

Registered User.
Local time
Yesterday, 23:47
Joined
Apr 22, 2002
Messages
1,281
I had this code behind my delete button (used the button wizard for this). This is an Access 97 database

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

But it stopped working. I've changed it to this.

PHP:
DoCmd.RunCommand acCmdDeleteRecord
Me.Refresh

It now works but why did it suddenly stop working??

Is it because I've modified the menus in Access?
 
It is obsolete code - Microsoft just haven't got round to telling their Wizards yet.

I'm guessing that with changing the menus you are performing a completely different action if, indeed, one exists.

DoCmd.RunCommand acCmdDeleteRecord is what you should be using.
 
Mile-O-Phile,

Thanks! That's kinda scary to think about . Am now worried about any other buttons that I've created using the Button Wizard!
:eek:
 
Just be wary of:

DoCmd.DoMenuItem statements...
 

Users who are viewing this thread

Back
Top Bottom