O'Reilly logo

Access 2003 VBA Programmer's Reference by Armen Stein, Graham Seach, Teresa Hennig, Patricia Cardoza

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

E.13. The DoCmd Object

As its name implies, this object allows you to do things within Microsoft Access. There are no properties of the DoCmd object, but there are a variety of methods you can utilize within your Access application.

E.13.1. Methods of the DoCmd Object

The methods of the DoCmd object are listed in the following table. All of the methods here actually carry out an action with the same name as the method. We've included the description of the action, rather than the description of the method (which merely calls the action).

MethodArgumentsDescription
AddMenuMenuName, MacroName, StatusBarTextCreates a custom menu bar, shortcut bar, or shortcut menu
ApplyFilterFilterName, WhereConditionUsed to apply a filter, a query, or a SQL WHERE clause to a table, form, or report
BeepNoneCauses the system to beep
CancelEventNoneUsed to cancel the event that caused Access to run the macro or module containing this action
CloseObjectType, ObjectName, SaveCloses the object specified in the ObjectName argument
CopyDatabaseFileDatabaseFileName, OverwriteExistingFile, DisconnectAllUsersCopies the database connected to the current project to a SQL Server database for export
CopyObjectDestinationDatabase, NewName, SourceObjectType, SourceObjectNameCopies the specified object to another database (mdb) or Access project (adp)
DeleteObjectObjecType, ObjectNameDeletes the specified object
DoMenuItemMenuBar, MenuName, Command, SubCommand, VersionExecutes the specified menu item (Note: This is a legacy ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required