Welcome to the forum....
It appears that you have 3 object types with the same name:
A query with the name "Disbursements Sum Query",
A form with the name "Disbursements Sum Query" and
A report with the name "Disbursements Sum Query"
It has been a while since I looked into this, but IIRC, this is possible because internally, Access adds a prefix to each object type.
A query would be named "Query_Disbursements Sum Query", a form would be named "Form_Disbursements Sum Query" and a report would be named "Report_Disbursements Sum Query".
BUT you should never use these names for anything! Again, these are ACCESS INTERNAL names.
It would be much better to use prefixes like "qryDisbursementsSumQuery", "frmDisbursementsSumQuery" and "rptDisbursementsSumQuery"
(Notice I removed the spaces. You should never use spaces in object names.)
There is a much easier method to limit the records in a report.
The report record source should be
Code:
"SELECT [Catagoey],[Disbursements],[Sum Of Total] FROM [Disbursements Sum Query]
This will return all records. To limit the records, use the WhereCondition parameter of the DoCmd.OpenReport Method
The DoCmd syntax is
Code:
DoCmd.OpenReport(ReportName, View, FilterName, WhereCondition, WindowMode, OpenArgs)
So the VBA code would look like:
Code:
Private Sub Command13_Click()
On Error GoTo Err_Command13_Click
Dim stDocName As String
stDocName = "Disbursements Sum Query" '<<-- if this is a report, why is "query" in the report name??
DoCmd.OpenReport stDocName, acPreview,, "[Date By Year]=" & Me.[Combo7]
Exit_Command13_Click:
Exit Sub
Err_Command13_Click:
MsgBox Err.Description
Resume Exit_Command13_Click
End Sub
There would not be code in the report open event.
Good luck with your project....