I found a tool that counts the number of connections available in an access db. I downloaded it and placed the form in the database. I then made the respective sub public and called it at various points below as you can see [Form_Frm_dialog_Available_Connections.SUpdateRemark]. I then took each respective result and placed it into the code after an arrow so you can see where the connections are being used and then freed up again.

249
initially available at 2020-02-19 5:01:29 PM
Set rst = db.OpenRecordset("SELECT * FROM BaseQry_ViewRcpts WHERE RcptSent = False ORDER BY RcptBatchID;")
If rst.RecordCount = 0 Then
MsgBox "There are no other unprinted receipts from those dates."
Exit Sub
End If
rst.MoveFirst
RemContactID = rst![DonorID]
MyRcptNo = rst![RcptBatchID]
Form_frm_dialog_Available_Connections.sUpdateRemark --> 242 available
DoCmd.OpenReport "Donation_Rcpt", acViewReport, , , acHidden
Form_frm_dialog_Available_Connections.sUpdateRemark --> 228 available
Report_Donation_Rcpt.Requery
Form_frm_dialog_Available_Connections.sUpdateRemark --> 228 available
DoCmd.OpenReport "Donation_Rcpt", acViewNormal, , , acHidden
Form_frm_dialog_Available_Connections.sUpdateRemark --> 228 available
DoCmd.Close acReport, "Donation_Rcpt", acSaveNo
Form_frm_dialog_Available_Connections.sUpdateRemark --> 242 available
rst.Close
Form_frm_dialog_Available_Connections.sUpdateRemark --> 248 available
Set rst = Nothing
Form_frm_dialog_Available_Connections.sUpdateRemark --> 248 available
Set rst = db.OpenRecordset("SELECT * FROM BaseQry_ViewRcpts WHERE RcptBatchID = GetMyItemizedRcpt() ORDER BY RcptBatchID;")
Form_frm_dialog_Available_Connections.sUpdateRemark --> 242 available
rst.MoveFirst
KeepName1 = rst![IssueName] & "." & Right(rst![ReceiptNo], 3) 'Prepare file name for PDF print
DoCmd.OpenReport "Donation_Rcpt", acViewReport, , , acHidden
Form_frm_dialog_Available_Connections.sUpdateRemark --> 228 available
Report_Donation_Rcpt.Requery
Form_frm_dialog_Available_Connections.sUpdateRemark --> 228 available
DoCmd.OutputTo acOutputReport, "Donation_Rcpt", acFormatPDF, "C:\Users\Camp.Director\Documents\New Tax ReceiptsTEST" & KeepName1 & ".pdf"
Form_frm_dialog_Available_Connections.sUpdateRemark --> 225 available
rst.Edit
rst![RcptSent] = True
rst.Update
DoCmd.Close acReport, "Donation_Rcpt", acSaveNo
Form_frm_dialog_Available_Connections.sUpdateRemark --> 239 available
rst.Close
Form_frm_dialog_Available_Connections.sUpdateRemark --> 245 available
Set rst = Nothing
Form_frm_dialog_Available_Connections.sUpdateRemark --> 245 available
Code is resent to top until no receipts are remaining.

The second time around every dialog came back as 3 less than the previous one from the same spot.
It Errors 75 records later, during the attempt to DoCmd.OutputTo… which is 23 less than the beginning of that round
75 * 3 = 225 and 225 + 23 = 248 So it has no connections left and does not allow the action to occur. I could be one rotation out as well, meaning that it may try to drop to -3 at that point. Either way that is why it errors.

When you study the places the available connections drop and then rise again, you can see that:
rst.close compensates for set rst = db.OpenRecordset
DoCmd.Close acReport compensates for DoCmd.OpenReport
But nothing compensates for DoCmd.OutputTo acOutputReport
There should be a DoCmd.OutputTo acCloseOutputReport

I removed the second report requery and ran it again, and here is a chart of the important points, for both first and second runs, both ways. I am not sure how this chart will render, and will send an image if it doesn't look readable.


2nd requery in place 2nd requery removed
Iteration 1st 2nd 1st 2nd
Start 249 245 249 248
Open rst 242 239 242 242
Open Report 228 225 228 228
Close Report 242 239 242 242
Close rst 248 245 248 248
Open rst 242 239 242 242
Open Report 228 225 228 228
OutputTo 225 222 228 228
Close Report 239 236 242 242
Close rst 245 242 248 248