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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

object variable error at runtime

Status
Not open for further replies.

shelron

Technical User
Apr 9, 2002
135
0
0
US
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 removed the declaration of the text box and all is well, thanks anyway,

ron
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top