ACC: Version Argument for DoMenuItem (2.0/95) (112065)



The information in this article applies to:

  • Microsoft Access 2.0
  • Microsoft Access for Windows 95 7.0

This article was previously published under Q112065
Novice: Requires knowledge of the user interface on single-user computers.

SUMMARY

When the menu structure changed from Microsoft Access version 1.x to Microsoft Access version 2.0, a new argument was added to the DoMenuItem action. The new version argument enables you to use code written for either a version 1.x, 2.0, or 7.0 database. Note that this argument is only available in code.

MORE INFORMATION

In Microsoft Access version 7.0

The version argument takes either of three constants: acMenuVer1X, acMenuVer20, or acMenuVer70. The default for this argument is acMenuVer1X.

If you write code in Microsoft Access 7.0, and you want to use version 7.0 menu commands, set this argument to acMenuVer70.

The syntax for the DoMenuItem method is:
DoCmd.DoMenuItem menubar, menuname, command [,subcommand][,version]
				
The following example using the above syntax chooses Paste from the Edit menu in form Design view in Microsoft Access 7.0:
DoCmd.DoMenuItem 3, acEditMenu, acPaste,  , acMenuVer70
				

In Microsoft Access version 2.0

The version argument takes either of two constants: A_MENU_VER1X or A_MENU_VER20. The default for this argument is A_MENU_VER1X.

If you write code in Microsoft Access version 2.0 and you want to use version 2.0 menu commands, set this argument to A_MENU_VER20.

The syntax for the DoMenuItem action is:
DoCmd DoMenuItem menubar, menuname, command [,subcommand][,version]
				
The following example using the above syntax chooses Paste from the Edit menu in form Design view in Microsoft Access 2.0:
DoCmd DoMenuItem A_FORMBAR, A_EDITMENU, A_PASTE, ,A_MENU_VER20
				

REFERENCES

For more information about the DoMenuItem action, search for DoMenuItem, and then "DoMenuItem method" using the Microsoft Access for Windows 95 Help Index.

For more information about the DoMenuItem action, search for DoMenuItem, and then "DoMenuItem Action" using the Microsoft Access 2.0 Help menu.

Modification Type:MinorLast Reviewed:10/11/2006
Keywords:kbinfo kbProgramming KB112065