You do not have to ever declare any
If you use the ThisDb construct
You just use ThisDB as if CurrentDb was a well formed Object
e.g.
or
and you won't run into any problems. You can do that as many times and in as many places in the same project as you need to. Every time you make a declaration and an assignment, it is a redundant repetition and it tells on the speed
If the construct where to be in a class, unless it is PublicNotCreata ble (which is more or less a glorified std module), it has to be instantiated to be used. That (I think) would be too much hassle for just CurrentDb.
Code:
Dim db as DAO,Database and set db = ThisDb
You just use ThisDB as if CurrentDb was a well formed Object
e.g.
Code:
Set tbl = ThisDb.TableDefs("SomeTable")
Debug.Print tbl.Fields("SomeName"),Value
Code:
With ThisDb ... someVar = .SomeProperty .... End with
If the construct where to be in a class, unless it is PublicNotCreata ble (which is more or less a glorified std module), it has to be instantiated to be used. That (I think) would be too much hassle for just CurrentDb.
Comment