I am trying to update a textbox on a report with data from a table that is not part of record source for the report.
I am trying to get the sum of the field "admin_amount" from the table "tblAdminAllowance", then pass the result to a text box "txtAdminSum" on the report footer.
This code returns "runtime error 91 Object variable or with block variable not set"
The dsum appears to be working, it returns the right value, just can't pass it to the text box.
Any help greatly appreciated, Ron
Private Sub Report_Activate()
Dim CurAdmin As Currency
Dim txtAdminSum As TextBox
CurAdmin = DSum("[ADMIN_AMOUNT]", "tblAdminAllowance", "[ADMIN_AMOUNT]is not null"
txtAdminSum = CurAdmin
End Sub
I am trying to get the sum of the field "admin_amount" from the table "tblAdminAllowance", then pass the result to a text box "txtAdminSum" on the report footer.
This code returns "runtime error 91 Object variable or with block variable not set"
The dsum appears to be working, it returns the right value, just can't pass it to the text box.
Any help greatly appreciated, Ron
Private Sub Report_Activate()
Dim CurAdmin As Currency
Dim txtAdminSum As TextBox
CurAdmin = DSum("[ADMIN_AMOUNT]", "tblAdminAllowance", "[ADMIN_AMOUNT]is not null"
txtAdminSum = CurAdmin
End Sub