Home  Fees/Services  Access Templates  Tutorials  Tutorial Downloads  Articles  Search  Contact  Privacy  Links


VBA Runcommand Tutorial  

Consulting Home > Programming Tutorials > RunCommand Method




Microsoft Office:
  MS Access 2003
  Access 2007
  Access 2010
  Access 2013

<% dim Gnum,Ynum Gnum="7916135873" Ynum="26695" %>

Programming Access RunCommand in Visual Basic

Every menu item in Microsoft Access has an associated RunCommand argument. This menuitems can therefore be run from within Access Visual Basic. You can't use the RunCommand method to run a command on a custom menu. You can only use it with built-in menus.

The RunCommand method replaces the DoMenuItem method of the DoCmd object.

There is some overlap between DoCmd and RunCommand actions.  The DoCmd method often gives you more control over equivalent RunCommand methods.

(note: we will be adding definitions and descriptions of the functions for each RunCommand option in future updates of this page)


RunCommand AcCommand Constants with numeric equivalent

acCmdAboutMicrosoftAccess    35

Docmd.RunCommand acCmdAboutMicrosoftAccess caused the Microsoft Access about box to open

acCmdAddInManager    526

Docmd.RunCommand acCmdAddInManager causes the COM add in manager to popup

acCmdAddToNewGroup    494

Docmd.RunCommand acCmdAddToNewGroup is not available at run time - unable to get this command to function

acCmdAddWatch    201

Docmd.RunCommand acCmdAddWatch  not available at runtime.

More RunCommand Method Examples:

Access Database Security Alternative
RunCommand acCmdSaveRecord ' ' set global access level to failsafe no access then lookup access level ' GBL_Access_Level = "X" ...

NotInList Event in Microsoft Access
RunCommand acCmdSaveRecord Form_F_Trds_Unbnd.Accnt_Name_Entry.Requery Form_F_Trds_Unbnd.Accnt_Number_Combo.Requery ' Form_F_Trds_Unbnd.Accnt_ID = Me...


Contact Information>

Visual Basic Runcommend Programming
Microsoft Access 2010 2007 2003 2000 and  All Windows Versions