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 » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

IFF Statement, 3 options



 
 
Thread Tools Display Modes
  #1  
Old December 20th, 2006, 08:38 PM posted to microsoft.public.access.forms
chickalina
external usenet poster
 
Posts: 194
Default IFF Statement, 3 options

How come this doesn't work?

=IIf(IsNull([txt_cumulamt7]),"",IIf([txt_cumulamt7]050,"","Benefit
Recognized"),IIf([txt_cumulamt7]1,"",""))

If the field is Null, then nothing appears
If the field is less than 50, but more than 0 then Benefit Recognized
If the field is 0, then nothing goes in the box
Thanks in advance!
  #2  
Old December 20th, 2006, 09:02 PM posted to microsoft.public.access.forms
David F Cox
external usenet poster
 
Posts: 493
Default IFF Statement, 3 options

at a quick glance this looks to me like it resolves to:
IIf([txt_cumulamt7] BETWEEN 1 AND 49,"Benefit Recognized,"")


"chickalina" wrote in message
...
How come this doesn't work?

=IIf(IsNull([txt_cumulamt7]),"",IIf([txt_cumulamt7]050,"","Benefit
Recognized"),IIf([txt_cumulamt7]1,"",""))

If the field is Null, then nothing appears
If the field is less than 50, but more than 0 then Benefit Recognized
If the field is 0, then nothing goes in the box
Thanks in advance!



  #3  
Old December 20th, 2006, 09:07 PM posted to microsoft.public.access.forms
Steve Schapel
external usenet poster
 
Posts: 1,422
Default IFF Statement, 3 options

Chickalina,

You have a few syntax errors in the expression. The parentheses and
commas are wrong, for example the first IIf() function has 4
comma-separated arguments. As far as I know, the construct 050
doesn't make sense. If you want "nothing", then you should use Null,
not "" which is a zero-length string, not nothing.

So, to read from your description of what you want, try it like this:

=IIf([txt_cumulamt7]0 And [txt_cumulamt7]50,"Benefit Recognized",Null)

Another way, if the txt_cumulamt7 contains integer values:

=IIf([txt_cumulamt7] Between 1 And 49,"Benefit Recognized",Null)

--
Steve Schapel, Microsoft Access MVP

chickalina wrote:
How come this doesn't work?

=IIf(IsNull([txt_cumulamt7]),"",IIf([txt_cumulamt7]050,"","Benefit
Recognized"),IIf([txt_cumulamt7]1,"",""))

If the field is Null, then nothing appears
If the field is less than 50, but more than 0 then Benefit Recognized
If the field is 0, then nothing goes in the box
Thanks in advance!

  #4  
Old December 20th, 2006, 09:10 PM posted to microsoft.public.access.forms
fredg
external usenet poster
 
Posts: 4,386
Default IFF Statement, 3 options

On Wed, 20 Dec 2006 11:38:01 -0800, chickalina wrote:

How come this doesn't work?

=IIf(IsNull([txt_cumulamt7]),"",IIf([txt_cumulamt7]050,"","Benefit
Recognized"),IIf([txt_cumulamt7]1,"",""))

If the field is Null, then nothing appears
If the field is less than 50, but more than 0 then Benefit Recognized
If the field is 0, then nothing goes in the box
Thanks in advance!


You need to repeat the criteria field name each time.
You need to use the And or Or operator when applicable.

=IIf(IsNull([txt_cumulamt7]),"",IIf([txt_cumulamt7] 0 and
[txt_cumulant] 50,"Benefit Recognized","It's equal to or greater than
50 or less than 0"))

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
  #5  
Old December 20th, 2006, 09:15 PM posted to microsoft.public.access.forms
chickalina
external usenet poster
 
Posts: 194
Default IFF Statement, 3 options

Actually, upon further discussion it's more like this:

=IIf(IsNull([txt_cumulamt7]),"Continue
Assessment",IIf([txt_cumulamt7]050,"","Benefit
Recognized"),IIf([txt_cumulamt7]1,"",""))

If the field is Null or 50, then Continue Assessment
If the field is = or more than 50 ,then Benefit Recognized
If the field is 0, then nothing goes in the box

Blimey, if they could just confirm what they want ahead of time. sheesh!


"David F Cox" wrote:

at a quick glance this looks to me like it resolves to:
IIf([txt_cumulamt7] BETWEEN 1 AND 49,"Benefit Recognized,"")


"chickalina" wrote in message
...
How come this doesn't work?

=IIf(IsNull([txt_cumulamt7]),"",IIf([txt_cumulamt7]050,"","Benefit
Recognized"),IIf([txt_cumulamt7]1,"",""))

If the field is Null, then nothing appears
If the field is less than 50, but more than 0 then Benefit Recognized
If the field is 0, then nothing goes in the box
Thanks in advance!




  #6  
Old December 20th, 2006, 09:24 PM posted to microsoft.public.access.forms
Steve Schapel
external usenet poster
 
Posts: 1,422
Default IFF Statement, 3 options

Chickalina,

Blimey, what you have in the description and what you have in the
quasi-expression are not at all similar.

If you go by the description, I would try it like this...

=IIf([txt_cumulamt7]=0,Null,IIf([txt_cumulamt7]50,"Benefit
Recognized","Continue Assessment"))

--
Steve Schapel, Microsoft Access MVP

chickalina wrote:
Actually, upon further discussion it's more like this:

=IIf(IsNull([txt_cumulamt7]),"Continue
Assessment",IIf([txt_cumulamt7]050,"","Benefit
Recognized"),IIf([txt_cumulamt7]1,"",""))

If the field is Null or 50, then Continue Assessment
If the field is = or more than 50 ,then Benefit Recognized
If the field is 0, then nothing goes in the box

Blimey, if they could just confirm what they want ahead of time. sheesh!

 




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 07:10 PM.


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