Re: DoCmd.DoMenuItem in Access 2007

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


"Chegu Tom" <noemail@xxxxxxxxx> wrote in message news:OFEmO$nJKHA.4376@xxxxxxxxxxxxxxxxxxxxxxx
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.

.



Relevant Pages

  • Re: Cloning a record
    ... Is there a way to get the wizard to generate code in the readable style you ... > The command button wizard will build a button to do this for you. ... > RunCommand acCmdSelectRecord ... > new record you created before you get to edit it, ...
    (microsoft.public.access.forms)
  • Re: Delete record code
    ... Also the runcommand typically works with the SINGLE currently selected record ... with "multiple selection" (that is when you click the selection bar in the ... >> Using the Command Button Wizard to make a button to delete the current ...
    (microsoft.public.access.formscoding)
  • Re: Command Button "Find"
    ... Did adding the RunCommand help? ... Allen Browne - Microsoft MVP. ... Tips for Access users - http://allenbrowne.com/tips.html ... When I exit out of my Main Menu and open my "Members/Contributions" form ...
    (microsoft.public.access.forms)
  • Re: Should we Convert to Access 2007?
    ... using the RunCommand acCmdWorkgroupAdministrator Module I created I ... I successfully was able to connect using RunCommand ... Tips for Access users -http://allenbrowne.com/tips.html ... RunCommand acCmdUserAndGroupAccounts ...
    (comp.databases.ms-access)