Text Box Expression Problem

PaulA

Registered User.
Local time
Today, 19:29
Joined
Jul 17, 2001
Messages
416
Hi, All--

I am having a "sudden" problem with a text box expression on a report where I get an "error" return where previously I received a value. These expressions did work in the past and I don't know what I did that would have changed anything. I have tried simplifying (just doing a simple DSum expression) as a test but still get the "error" result. The expression is supposed to return a zero or a count when meeting the criteria. I have checked and rechecked the query and field names (like I said, it had worked before). Any thoughts?

Here is the expression:

=IIf(IsNull(DSum("[YTD]","qryIncidentLog-Year-crosstab","[UrgencyID]=3")),0,DSum("[YTD]","qryIncidentLog-Year-crosstab","[UrgencyID]=3"))

Thanks.
 
Try this
=IIf(IsNull(DSum("[YTD]","qryIncidentLog-Year-crosstab","[UrgencyID]=3")),0,(DSum"[YTD]","qryIncidentLog-Year-crosstab","[UrgencyID]=3"))
 
Thanks for the response--

Didn't work. It looked like the only change was moving a parenthases from after the 2nd "DSum" to before it--wouldn't there need to be a parenthases after to contain the arguments? (I tried just adding a parenthases in front of "DSum" and adding a closing one, but it didn't work either...)
 
It looks like we missed one more parenthesis. Try this



=IIf(IsNull(DSum("[YTD]","qryIncidentLog-Year-crosstab","[UrgencyID]=3")),0,(DSum("[YTD]","qryIncidentLog-Year-crosstab","[UrgencyID]=3"))
 
Didn't work

The latest didn't work, either. I had basically done the same thing as a test--required a 3rd closing parentheses, which would be fine, if it worked!! All the parenthases seem to be OK--it's apparently something else.

I think the expression is OK. Could it be something else causing it? I'm wondering if it has to do with the source query, although, as I had said, the query name and field name have been checked and are correct.

I am actually having the same problem in another database--a situation where it had worked in the past but now am getting the "#error" output.

Very strange...and irritating!!
 
Try deleting the original text box, save the report, add a new textbox and past the code in again, failing that there can be errors elsewhere on the report causing the error to appear in your textbox
 

Users who are viewing this thread

Back
Top Bottom