Why is my report crashing

J

JOM

I have the following information in an unbound textbox but when I try to run
the report, Access closses itself, any reason as to why this could be
happening?

="Out Of Standard: " &
Abs(Sum(IIf([TaxDocStatus]="Complete",(IIf((([TaxDocName]="W2" Or
[TaxDocName]="1099") And DateDiff("d",[RqstDateRcvd],[TxDocDateRcvd])-
DateDiff("ww",[RqstDateRcvd],[TxDocDateRcvd],7)-DateDiff("ww",[RqstDateRcvd],[TxDocDateRcvd],1)>10)
Or [TaxDocName]="1040" Or [TaxDocName]="1065" Or [TaxDocName]="1120"And
DateDiff("d",[RqstDateRcvd],[TxDocDateRcvd]-DateDiff("ww",[RqstDateRcvd],[TxDocDateRcvd],7)-DateDiff("ww",[RqstDateRcvd],[TxDocDateRcvd],1))>2,1,0)))))
 
J

Jerry Whittle

It's possible that the report is corrupt. You could import from a backup and
see if it works.

Your statement is rather complicated. Try stripping out some of the
statements and see if it works.

You could simplify some of the statement by changing the Or clauses to an In
statement. For example:

[TaxDocName]="1040" Or [TaxDocName]="1065" Or [TaxDocName]="1120"

becomes

[TaxDocName] in ("1040","1065","1120")
 
J

JOM

Thanks for the reply, I changed the or clauses to in as you said and am
getting an error that the expression you entered has a function containing
the wrong mumber of arguments....

This is how it looks like now....

="Out Of Standard: " &
Abs(Sum(IIf([TaxDocStatus]="Complete",(IIf((([TaxDocName] in("W2","1099") And
DateDiff("d",[RqstDateRcvd],[TxDocDateRcvd])-
DateDiff("ww",[RqstDateRcvd],[TxDocDateRcvd],7)-DateDiff("ww",[RqstDateRcvd],[TxDocDateRcvd],1)>10)
Or [TaxDocName] in("1040", "1065","1120")And
DateDiff("d",[RqstDateRcvd],[TxDocDateRcvd]-DateDiff("ww",[RqstDateRcvd],[TxDocDateRcvd],7)-DateDiff("ww",[RqstDateRcvd],[TxDocDateRcvd],1))>2,1,0)))))



Jerry Whittle said:
It's possible that the report is corrupt. You could import from a backup and
see if it works.

Your statement is rather complicated. Try stripping out some of the
statements and see if it works.

You could simplify some of the statement by changing the Or clauses to an In
statement. For example:

[TaxDocName]="1040" Or [TaxDocName]="1065" Or [TaxDocName]="1120"

becomes

[TaxDocName] in ("1040","1065","1120")
--
Jerry Whittle
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


JOM said:
I have the following information in an unbound textbox but when I try to run
the report, Access closses itself, any reason as to why this could be
happening?

="Out Of Standard: " &
Abs(Sum(IIf([TaxDocStatus]="Complete",(IIf((([TaxDocName]="W2" Or
[TaxDocName]="1099") And DateDiff("d",[RqstDateRcvd],[TxDocDateRcvd])-
DateDiff("ww",[RqstDateRcvd],[TxDocDateRcvd],7)-DateDiff("ww",[RqstDateRcvd],[TxDocDateRcvd],1)>10)
Or [TaxDocName]="1040" Or [TaxDocName]="1065" Or [TaxDocName]="1120"And
DateDiff("d",[RqstDateRcvd],[TxDocDateRcvd]-DateDiff("ww",[RqstDateRcvd],[TxDocDateRcvd],7)-DateDiff("ww",[RqstDateRcvd],[TxDocDateRcvd],1))>2,1,0)))))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top