• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 28. Responding to Events with VB... > Working with Access 97's DoCmd Metho...

Working with Access 97's DoCmd Methods

Some of the DoCmd methods duplicate menu commands, such as Print, Close, and Apply Filter/Sort. Other methods substitute for mouse actions. For example, you can use the SelectObject method to select a database object in the same way that you select an open window by clicking it or select a database object in the Database window by clicking the object's name. Other DoCmd methods provide capabilities that are not available through menu commands, such as Beep, which emits a beep sound, or MsgBox, which displays a custom message.

Table 28.3 lists available DoCmd methods grouped by task. Access 2.0 provided 47 macro actions; Access 95 added two new DoCmd methods: Save and SetMenuItem. Access 97 replaces the DoMenuItem action or method with the RunCommand method, which lets you execute any native menu choice or standard toolbar button. The AddMenu item in the Method column of Table 28.3 is an Access 95 and earlier macro action; it is not a method of the DoCmdM object and cannot be executed from Access VBA code.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint