DoCmd.DoMenuItem in Access 2007

C

Chegu Tom

Never trust a wizard!

The command button wizard in previous versions of access made extensive use
of DoCmd.DoMenuItem which isn't available in 2007

I have found, for example, that

DoCmd.RunCommand acCmdFind
does the same as
DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70

Is there a list available of alternatives to DoCmd.DoMenuItem (especially
those used by the previous button wizards)? I have some sloppy code to fix
before my users change to Office 2007.
 
A

Allen Browne

The 500 odd options in RunCommand provide most of the old DoMenuItem
functionality. They all start with acCmd, and they are generally not that
hard to spot if you have an idea of what you want to do, e.g.:
RunCommand acCmdSaveRecord
RunCommand acCmdRecordsGotoNew

If you wish to study the RunCommand constants, Terry Wickenden's list is
probably the best source:
http://www.accessruncommand.com/

In some cases, there are better ways to do things, e.g. to undo the edits in
a bound form, use:
If Me.Dirty Then Me.Undo

For more general guidelines on what you might need to know to convert to
A2007, see:
http://allenbrowne.com/Access2007.html
 

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