I have seen in a lot of example code with recordsets and such where the programmer first creates a database object, then sets that object to the CurrentDb object, and then uses the new database object to open recordsets.
My question is, why go to the trouble of making a new database object.
Dim dbCurr as Database
Dim rs as Recordset
Set dbCurr = CurrentDb
Set rs = dbCurr.OpenRecordset("tblMyTable")
I will agree with you for a local database. But, if you are using multiple databases at different locations, you will need to set the location for your databases. Some programmers just stick to one method and use it regardless of database location.
Dim dbPath as String
Dim db as Database
dbPath = "C:\Folder\Database.mdb"
Set db = DBEngine.Workspaces(0).OpenDatabase(dbPath)
so what you are saying, is that if I am only using 1 database, then I should probably create a global variable at the beginning of my project and set it to CurrentDb and then reference that database object whenever I need to open a recordset. I don't see any "cost savings" if for each subroutine you re-define a database object and set it to CurrentDb, because doing it that way you will still be making a lot of calls to CurrentDb.