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

14. Programming DAO: Overview > 14.9. The CurrentDb Function

The CurrentDb Function

We have seen that DAO refers to the current database as:

DBEngine.Workspaces(0).Databases(0)

or, through default collections, as:

DBEngine(0)(0)

However, within Microsoft Access, there is a preferred way to refer to this database, since, unlike DBEngine(0)(0), it is always current with respect to changes made using the Access graphical interface. This preferred way is to use the Access function CurrentDb. Unfortunately, there is some confusion as to precisely what this function does.

Here is part of what the Access help system says about this function:

The CurrentDb function returns an object variable of type Database that represents the database currently open in the Microsoft Access window.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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