How to have Report print... "Paid" if PmtAmt>0 ?

M

Mel

We have a Report getting data from a Query...

Query is qryPaymentStatus
Report is rptPaymentStatus

The Query has a field named PmtAmt (which contains the amount paid...
if the order is paid).

We need the report to show "Paid" if PmtAmt>0, else "Unpaid"

or some such.

Can I do this with a simple like of code in the Report field... or use
a Macro or what?... and How?

Thanks for any help.
 
R

RonaldoOneNil

Just put a textbox on the report with its control source set to

=IIF([PmtAmt]>0,"Paid","Unpaid")
 
F

fredg

We have a Report getting data from a Query...

Query is qryPaymentStatus
Report is rptPaymentStatus

The Query has a field named PmtAmt (which contains the amount paid...
if the order is paid).

We need the report to show "Paid" if PmtAmt>0, else "Unpaid"

or some such.

Can I do this with a simple like of code in the Report field... or use
a Macro or what?... and How?

Thanks for any help.

Add an unbound control to the report.
Set it's Control source to:
=IIf([PmtAmt]>0,"Paid","Unpaid")

What will you do if the [PmtAmt] is >0 but not the full amount due?
 
M

Mel_3

I can't get this to work.

In the Report field I built the "Control Source" using the Expression
Builder... and it looks like this...

=IIf([qry_Status]![OrdPmtAmt]>0,"Paid","Unpaid")

But when I run the Report I get a Dialog Box like this...

Enter Parameter Value
qry_Status
_______________

qry_Status gets its data from a number of related tables.

I guess the syntax is wrong... Can anybody tell me how to fix it?

Thanks for the help.
 
D

Douglas J. Steele

Is qry_Status the RecordSource of the report?

Try

=IIf([OrdPmtAmt]>0,"Paid","Unpaid")
 
M

Mel_3

Got it.

=IIf([OrdPmtAmt],"Paid","UnPaid")

Works... I had to build it getting the OrdPmtAmt from the Report not
from the Query.

Thanks for the help folks!
 

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