I recently split my database. My form is a calendar with a Tab
for Month View, Week View, and Day View with 42, 7, and 7 subforms, respectively. All of these subforms are unbound. When a tab is selected, all the subforms in that tab is assigned a ControlSource
while all other subforms are cleared of its ControlSource
.
The Month View is the only one that gets Error 3048: Cannot open any more databases.
after it loads 23 subforms (there are a few labels, lists, and buttons outside the Tab
, but I do not think they are significant).
When the Month View tab is selected, the following actions occur:
- A 42x2 array is filled with
Long
date information
- All subforms are cleared of its
SourceObject
- For all subforms in the selected tab: Assign its
SourceObject
then call a function (located in the SUBform) to Filter
itself. In this function, another function is called to count the number of records in the subform based on some criteria. A database and recordset is created here and passed through several times before the recordset is Closed
.
The Subform contains several text boxes with one containing a conditional format to color it. Its Record Source is the query:
SELECT tblTask.JobNum, tblJob.JobNum, tblTask.Sequence, tblJob.Closed, tblJob.Certified, tblEstimator.SortID, tblDivision.SortID, tblJob.EstimatorID, tblTask.DivisionID, tblJob.JobSite, tblJob.Customer, tblJob.Closed, tblTask.Item, tblTask.ItemDescription, tblTask.StartDate, tblTask.EndDate, tblTask.WeekendWork, tblEstimator.EstimatorNum & "-" & [FirstName] & " " & [LastName] & "20" & Mid([tblJob].JobNum,3,2) & " JOBS" AS JobMidFilePath
FROM (tblEstimator RIGHT JOIN tblJob ON tblEstimator.ID = tblJob.EstimatorID) RIGHT JOIN (tblDivision RIGHT JOIN tblTask ON tblDivision.ID = tblTask.DivisionID) ON tblJob.JobNum = tblTask.JobNum
WHERE (((tblJob.Closed)=False))
ORDER BY tblTask.JobNum, tblTask.Sequence, tblTask.StartDate, tblDivision.SortID;
Right now 521 records are returned with this query.
Is it expected that my form should not be able to handle all of this? Or is there a way to improve the efficiency of my form? I'm very lost about what I should do about this, since I need all 42 subforms to load.
Let me know if you need more information. Thanks in advance!
See Question&Answers more detail:
os