HrsAmt = DLookup("trp_ham", "qryTIMshtS", "[trp_id]=" & Me![Row_ID])
MilAmt = DLookup("trp_mam", "qryTIMshtS", "[trp_id]=" & Me![Row_ID])
RAmount = HrsAmt + MilAmt
RCount = DCount("trp_id", "qryTIMshtS")
HrsTot = DSum("trp_ham", "qryTIMshtS")
MilTot = DSum("trp_mam", "qryTIMshtS")
RTotal = HrsTot + MilTot
Three fields are on the report with:
The middle function works, but the other 2 do not. Can not, for the life of me, figure out why one works and the others do not. I spent over 4 hours now using every possible combination I know to make these work.
Found, contrary to normal math, that reports will not work if there is a null value anywhere.
It's not contrary to math. Remember that a null DOES NOT EQUAL zero. If you've ever programmed in a mid-level or low-level language before (such as C++ or something) than you know what a pointer is, and so you can understand better what a null is. Sometimes I think it's dangerous to let people program on a high-level language without first understanding a lower-level language, so as they understand what exactly the language is doing for them.
Bottom line, that's why you use Nz() function (or an IIF statement in a query). Or better yet, don't let yet your user leave null fields if it can be helped.
Since this is on-going DB dev and that has caused some fields to fill as Nulls the user has agreed to take responsibility for the nulls and fix these, but in the mean time the report has to work. Proof of Concept ya know.
Anyway thanks for input, I think I need to go back and set default values to "0" for these field, so they do not get nulls.