Not sure whether it's bad programming practice or not, but I have a module
of globals I declare in each system:
Global ws As Workspace
Global db As Database
Global td As TableDef
Global rs As Recordset, rs1 As Recordset
Global rs2 As Recordset, rs3 As Recordset
Global ctl As Control
Global frm As Form, subFrm As Form
Global rpt As Report
Global qItem As QueryDef
Global menuObject As Object
Most of them get used in each Access app, so I don't feel bad about
instantiating them this way. Saves some development time and hassles.
In general:
* I Set the db object to CurrentDB when opening forms, and never Close it.
* I always Set and Close the recordset objects I use.
* I Set the frm references as necessary, but never reset them to Nothing.
I'm wondering if declaring and using Global objects this way contributes to
system instability? When my apps reach a certain arbitrarily large size
(lots of forms and code), I always, always get the dreaded corruption
screen.
Usually it's recoverable, but sometimes not. And it always causes me to
curse.
Thoughts?