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

SUM VALUES FROM FORM AND SUB 1

Status
Not open for further replies.

shelron

Technical User
Apr 9, 2002
135
US
I am trying to sum two different fields and then add them to a table.

the form has a one, and a sub, many side


I want to take the value of textbox1 from the main form, and sum it with the value from textbox2 on the subform,

then have an event that updates textbox3 on the main form, thus updating the table.

I keep getting an error "invalid use of null"

Essentially, if the sub contains no data, I get the error.
 
It's hard to say where your problem lies without seeing your code, but you might try looking up help on the Nz() function which converts nulls to zero. "The Key, The Whole Key, and Nothing But The Key, So Help Me Codd!"
 
=([value1]+[RtblEquipmentAccessories subform]![TEXT13])


I have this function set on the control source of a text box, It works fine if I have values in the one and the many side of the tables,

but if I have no corresponding record on the subform, it returns nothing.
 
Try this:

=([value1] + Nz([RtblEquipmentAccessories subform]![TEXT13]))

This will convert the null value to a zero. "The Key, The Whole Key, and Nothing But The Key, So Help Me Codd!"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top