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 ...

Get Access 2003 VBA Programmer's Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.