Microsoft offers a shortcut you can use when creating an object variable that points to the current database. Using the CurrentDB() function, you do not need to first point at the workspace; nor do you need to issue the OpenDatabase method. Instead, you set the Database object variable equal to the result from the CurrentDB() function, as shown in Listing 14.48.
This code sets the Database object variable so that it points at the current database object. You cannot use the CurrentDB() function to refer to objects that are not part of the current database. As with all VBA functions that do not require arguments, the parentheses after CurrentDB are optional.