DoMenuItem versus RunCommand

Keith Nichols

Registered User.
Local time
Today, 06:13
Joined
Jan 27, 2006
Messages
431
Hi Folks,

If you use the wizard to create one of the standard buttons on a form, it gives you code for the DoMenuItem method for whatever you are looking for. eg the find button gives:

Code:
DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70

In another thread it was suggested that this was "old fashioned" and the correspondant suggested:

Code:
DoCmd.RunCommand acCmdFind

Can somone give a brief overview of the difference and any advantage of using one over the other?

For a relatively new coder, the wizard is the easiest way to get something up and running and seems to work pretty well.

Regards,

Keith.
 
Thanks Rural Guy.

The web site referenced clears up what the old domenu item command was all about.

Other than for clarity, is there any pressing need to update the code throughout the database?

Is there any way to get Access to default to the RunCommand when using the wizard for command buttons?

Regards,
 
Other than for clarity, is there any pressing need to update the code throughout the database?
Not really except you may find it easier to read the RunCommand code than the DoMenuItem code.
Is there any way to get Access to default to the RunCommand when using the wizard for command buttons?
Right now only MS has that ability.
 
Rural Guy,

Thanks once again.

As it is, I have only used the DoMenuItem with the Wizard generated command buttons. Even though the menu structure is a little opaque, the subroutine function is obvious from the button title etc.

As there is no perfomance hit, I won't go back through the DB updating these things but I'll probably clean them up as I go about doing the odd spot of tweaking or maintenance.

Regards,

Keith.
 

Users who are viewing this thread

Back
Top Bottom