Resources!
The "leaking" is because your PC has run out of resources. The general protection fault confirms the issue.
- Video memory. Insufficient memory will cause display problems, usually blank screens or icons with a black image
- Memory (RAM). When you run out of RAM, your computer will start to use your hard drive as "virtual memory". This will really slow things down since writing and reading from the hard drive is very slow compared to referencing active memory.
- Disk space. You need enough space in your TEMP files to handle the workspace used by Access. If you run out of disk space, your computer will really struggle looking for space to store TEMP work, and will end up spending all it's time "thrashing", looking for free space instead of resolving the instruction set.
So switch from tab form to tab subform and back and forth and crash.
For subforms in the tabs the control source is changed by the change event so that only the subforms of the current tab are bound.
Well, this approach is probably more kind on network traffic but harder on CPU usuage - requery, and requery.
But the other issue is if you are using RecordSets with ADO or DAO code are your freeing up resources afterward?
Code:
Dim dbs as DAO.Database, rst as DAO.RecordSet
'...
'Set dbs = CurrentDB()
'Set rst = dbs.OpenRecordSet(strSQL)
'...
rst.Close
Set rst = Nothing
dbs.Close
Set dbs = Nothing
If you do not close these types of objects, you may erode your available memory every time you open a new recordset without closing the other.
Richard