If null in textbox

G

Guest

Hello all, quick question I hope. I have a field on a report called
availcredit that is somtimes null and sometimes it has a number. I am trying
to make a new text box that uses availcredit in some calculations. Here is
what I have so far, I know that its totally wrong.

=IIf([avilcredit],IIf([avilcredit]=Null,[CurAvailCreditAmt]+[curprinbal]-[SoldExposureAmt]),([CurAvailCreditAmt]+[curprinbal]-[SoldExposureAmt]-[avilcredit]))

Here is what Im trying to do written a little more clearly.

If avilcredit.value = null then textbox.value =
(curavilcreditamt+curprinbal-soldexposureamt)

else textbox.value = CurAvailCreditAmt+curprinbal-SoldExposureAmt-avilcredit

currently when I put
=([CurAvailCreditAmt]+[curprinbal]-[SoldExposureAmt]-[avilcredit]) it works
great, but only in the rows where [avilcredit] is not null.

Another way that I think it would work would be possiblty in the avilcredit
text box, like an if null then avilcredit = 0. or somthing like that, it
would give the other textbox a number to calc.

The issue is beucase the avilcredit data that I am pulling comes from a
table that doesn't have any of ther other accounts on it, otherwise is would
put 0's automatically. Hope this was clear.. thanks!


James O
 
S

Stefan Hoffmann

hi James,

James said:
=IIf([avilcredit],IIf([avilcredit]=Null,[CurAvailCreditAmt]+[curprinbal]-[SoldExposureAmt]),([CurAvailCreditAmt]+[curprinbal]-[SoldExposureAmt]-[avilcredit]))

Here is what Im trying to do written a little more clearly.

If avilcredit.value = null then textbox.value =
(curavilcreditamt+curprinbal-soldexposureamt)

else textbox.value = CurAvailCreditAmt+curprinbal-SoldExposureAmt-avilcredit

=Iif(IsNull([avilcredit]),[CurAvailCreditAmt]+[curprinbal]-[SoldExposureAmt],[CurAvailCreditAmt]+[curprinbal]-[SoldExposureAmt]-[avilcredit])

should work.

mfG
--> stefan <--
 
G

Guest

Stefan,

That worked like a charm, I have one more question though. How would I sum
that in the report footer?

Thanks so much!

Stefan Hoffmann said:
hi James,

James said:
=IIf([avilcredit],IIf([avilcredit]=Null,[CurAvailCreditAmt]+[curprinbal]-[SoldExposureAmt]),([CurAvailCreditAmt]+[curprinbal]-[SoldExposureAmt]-[avilcredit]))

Here is what Im trying to do written a little more clearly.

If avilcredit.value = null then textbox.value =
(curavilcreditamt+curprinbal-soldexposureamt)

else textbox.value = CurAvailCreditAmt+curprinbal-SoldExposureAmt-avilcredit

=Iif(IsNull([avilcredit]),[CurAvailCreditAmt]+[curprinbal]-[SoldExposureAmt],[CurAvailCreditAmt]+[curprinbal]-[SoldExposureAmt]-[avilcredit])

should work.

mfG
--> stefan <--
 
S

Stefan Hoffmann

hi James,

James said:
That worked like a charm, I have one more question though. How would I sum
that in the report footer?
You can use =Sum(Iif(..)) in a TextBox in the footer
or better use a second TextBox for calculating a integrated total
(.RunningSum = True).

mfG
--> stefan <--
 

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