Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error: Cannot open any more databases

Status
Not open for further replies.

bbbum

Programmer
Mar 24, 2003
3
US
Hi all,

I have a report, which by necessity contains 12 sub reports. I print it with a "Print" cmd button on the form which is the form with the data I want to print, which also contains 12 sub forms. The "Print" cmd button opens the report showing the desired record(s) by using the WhereCondition. As I open the report I set the visible property of the form to No, so that I can easily return to the same record(s) on the form when the printing is completed by just setting the form's visible property to Yes when the report closes.

I need to first open the report with acViewPreview and when I do the report previews correctly, but when I click the print button on the report toolbar, the error message "Cannot open any more databases" appears 6 times, then the report prints but is missing 6 of the sub reports.

I have found by testing that if I close the from, instead of just making it not visible, that my report will print without problems. In both the form and the report, I use the same query as the data source for the form or report, and the sub reports and sub forms use tables as their data source. I can provide more exact details if need be.

I read on another forum that this error message is the result of an internal constraint within Access, but there was so little information available that I'm seeking the assistance of someone who can shed a little more light on the problem, and to see if there are any fresh ideas on a way to fix the problem without extensive redesign of the way I print this particular report.

Thanks a lot!!


 
Here is a forum where someone suggested its occurance being b/c of not removing recordsets when finished with them...


Another link you could try:

Maybe try this one as well.. (not a forum)


Stephen [infinity]
"Jesus saith unto him, I am the way, the truth, and the life:
no man cometh unto the Father, but by me." John 14:6 KJV
 
How are ya bbbum . . . . .

By any chance are the sub forms/reports nested beyond three levels?

Also, If I remember correctly (could be wrong), although subreports are hidden, they are still active and print along with the main form.

Calvin.gif
See Ya! . . . . . .
 
Hey AceMam, Thanks for your reply. No, my subForms & subReports are ony 1 deep. Input from other sources suggest I must be running out of table ID's, though since Jet 4.x supports 2048 ID's I can't see how. I should have 32 tables open, and they are all linked tables so I'm told in that case each table uses two table ID's, and the're opened three times (for the form, the report preview, and the report print) so that would be 64*3=192. Thee form and the report (along with their respective sub's each use the same query for their data source (e.g. subForm1 and subReport1 both use subQry1). Each query consumes a table ID too so that could account for 192 more table ID's, so we're up to 384. The queries each have 3 or 4 left joins to the open tables, so if each joint takes another table ID we're up to 1536. Still should have 512 availabel table ID's.

I've checked a couple of times to make sure I'm closing open recordsets opened by other routines, and the problem occurs even when this report is the first thing I call up, so the only thing that has executed previously is my startup menu.

It's just hard to accept that table ID's are really the problem, so I'm going to leave my question open for the time being.

-Ben-
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top