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).
Method | Arguments | Description |
---|---|---|
AddMenu | MenuName, MacroName, StatusBarText | Creates a custom menu bar, shortcut bar, or shortcut menu |
ApplyFilter | FilterName, WhereCondition | Used to apply a filter, a query, or a SQL WHERE clause to a table, form, or report |
Beep | None | Causes the system to beep |
CancelEvent | None | Used to cancel the event that caused Access to run the macro or module containing this action |
Close | ObjectType, ObjectName, Save | Closes the object specified in the ObjectName argument |
CopyDatabaseFile | DatabaseFileName, OverwriteExistingFile, DisconnectAllUsers | Copies the database connected to the current project to a SQL Server database for export |
CopyObject | DestinationDatabase, NewName, SourceObjectType, SourceObjectName | Copies the specified object to another database (mdb) or Access project (adp) |
DeleteObject | ObjecType, ObjectName | Deletes the specified object |
DoMenuItem | MenuBar, MenuName, Command, SubCommand, Version | Executes 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.