(in Access) I used "IIF" statement and get answers, but also get .

G

Guest

In an Access Query, I used an "IIF" statement where it looks at another field
and if the filed contains a certain word, it brings back the value of another
one (and vice versa). It works, except when I run it, it gives me an input
box for that field. Not sure how to make it go away. Here's the IIf
Statement:
USD Traded:
IIf(([PCurr]="USD"),[SumOfPAmount],(IIf(([SCurr]="USD"),[SumOfSAmount],0)))
 
G

Guest

Hi,
I am not clear about your question.
I assume that you have a table with at least four fields: PCurr, PAmt, SCurr
and SAmt, meaning that each record could have data in one or more of these
fields. Do we assume that, if PCurr has a currency type, SCurr is blank as
shown below?

PCurr PAmt SCurr SAmt
USD 2
XXX 3
USD 4
XXX 5
USD 6
 
G

Guest

Ken,

Thanks for your response. You're right, the table has at least those
fields. My IIF statement is looking for a specific currency (say USD) in
either "PCurr" or "SCurr". If USD is found, say on "PCurr", I want the IIF
statement to bring back the amount (as an answer on this new field) from
"PAmount" or if USD is found on "SCurr" then return "SAmount".

Like I said, it works fine and the answers are correct, it is just that I
get an Input Box asking for amounts related to "PAmount" or "SAmount". I'm
guessing because of the brackets I show. I just want that box to not appear
for my users.

Thanks.

Ken Hudson said:
Hi,
I am not clear about your question.
I assume that you have a table with at least four fields: PCurr, PAmt, SCurr
and SAmt, meaning that each record could have data in one or more of these
fields. Do we assume that, if PCurr has a currency type, SCurr is blank as
shown below?

PCurr PAmt SCurr SAmt
USD 2
XXX 3
USD 4
XXX 5
USD 6


KMORGADO said:
In an Access Query, I used an "IIF" statement where it looks at another field
and if the filed contains a certain word, it brings back the value of another
one (and vice versa). It works, except when I run it, it gives me an input
box for that field. Not sure how to make it go away. Here's the IIf
Statement:
USD Traded:
IIf(([PCurr]="USD"),[SumOfPAmount],(IIf(([SCurr]="USD"),[SumOfSAmount],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