A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

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



 
 
Thread Tools Display Modes
  #1  
Old March 22nd, 2005, 05:05 PM
KMORGADO
external usenet poster
 
Posts: n/a
Default (in Access) I used "IIF" statement and get answers, but also get .

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)))
  #2  
Old March 22nd, 2005, 09:49 PM
Ken Hudson
external usenet poster
 
Posts: n/a
Default

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" wrote:

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)))

  #3  
Old March 29th, 2005, 03:47 PM
KMorgado
external usenet poster
 
Posts: n/a
Default

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" wrote:

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" wrote:

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)))

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:59 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.