|
|
Access Object Model enables people to manipulate Access via VBA code and automation. While one can learn VBA fairly fast, understanding Access object model is essential to mastering Access programming. Note furthermore that there are typically additional object models distinct from Access, such as DAO and ADO, as well Excel and Word. In case of Access and DAO, the relationship are so intertwined that it can be easy to mistake for a single object model but understanding the delineation will help with setting expectation toward how so and so object should behave.
[edit] Access Object Model OverviewFor a full treemap of Access object model, refer to this MSDN page. The article focus on high-level understanding of the object model. Application object is considered the top level object from all other objects & methods derive. Whenever you're working in Access, it's rare to need to reference Application explicitly as it is implicitly. For example Application.CurrentDb() and CurrentDb() are fundamentally same thing. When you're automating Access from outside (e.g. from an Excel VBA module for example), then you do need explicit reference in this case. Most of UI actions available to users are also available programmatically via Access object model. [edit] Application ObjectThe top-level object. [edit] CurrentDb FunctionThe entry to the DAO.Database and therefore to the DAO object model. [edit] CurrentProject ObjectIntroduced in 2000, it provides additional and useful properties. [edit] DoCmd ObjectRepresents a programmatic interface for most interactive actions that user may take in Access. [edit] RunCommandTypically specific to menu and ribbon items and simulates clicking such item. The action is also context-sensitive, meaning that you can only call it when it's available as if you were actually using it interactively. If at a moment, that item would be disabled (because the focus is on wrong object for example), the action will not be available.
|
| This page was last modified 18:16, 11 December 2011. This page has been accessed 121 times. Disclaimers |