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

Getting a total for textbox contents derived from a field

Status
Not open for further replies.

huggybear

Technical User
Feb 15, 2001
83
US
I have a field, Duration which contains a time value. However, the time can come in either as a number of hours or as a number of minutes.

On my report I use an unbound textbox to display the time as hours derived by using Format(IIF([Duration] < 8, [Duration],[Duration]/60),&quot;Fixed&quot;) which works fine. However, if I try to calculate the total of that column I get #Error displayed in my total textbox (which is located in the report footer).

Can anyone point me in the right direction?

Thanks, Bear
 
it looks like you are trying to return a string &quot;fixed&quot;, if your expression evaluates as false. is that your intention? if so, totaling it would not make sense. drop the last argument from the expression and see if it works (you are already returning true/false without it.
 
Thank you demoman for your suggestion. What I was trying to do was get the time value for Duration to be formatted as a whole number and a decimal part. I am relying on VBA's ability to resolve types and it works for the most part here.

I have gotten the result I want by grouping the results by Subject (another field in the record source) and using a header and footer for that grouping.

I think my main problem was not fully understanding how to get aggregate results, the grouping was the key.

Again, thanks.

Bear
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top