NOOB - IIf question

  • Thread starter Thread starter Rohn
  • Start date Start date
R

Rohn

I thought I could place a condition in the control source in my report! That if the field [Proposed Increase] is blank (Null) then populate the field with No Increase?

Although it does not work! I am guessing that the problem is me :-) Here is what I put in the form.

=IIf(Null,[Proposed Increase],'No Increase')

Thanks for any help you can provide!
_____
Rohn Everson
 
You could just use the built in function....



Nz([Proposed Increase],"No Increase")



I thought I could place a condition in the control source in my report! That if the field [Proposed Increase] is blank (Null) then populate the field with No Increase?

Although it does not work! I am guessing that the problem is me :-) Here is what I put in the form.

=IIf(Null,[Proposed Increase],'No Increase')

Thanks for any help you can provide!
_____
Rohn Everson
 
Thanks, I didn't know such thing existed!

I have a different problem now. I get an error message saying that "Syntax error (comma) in query expression."

Any ideas?
_____
Rohn Everson
(712) 548-6900 (cell)
UOP email: (e-mail address removed)
Yahoo messenger: (e-mail address removed)
You could just use the built in function....



Nz([Proposed Increase],"No Increase")



I thought I could place a condition in the control source in my report! That if the field [Proposed Increase] is blank (Null) then populate the field with No Increase?

Although it does not work! I am guessing that the problem is me :-) Here is what I put in the form.

=IIf(Null,[Proposed Increase],'No Increase')

Thanks for any help you can provide!
_____
Rohn Everson
 
Hmmm. No idea. I think my syntax is correct. Wher I am using it, I have...

(Nz(UserID.OldValue, 0)


It may be because your field is a number and you are trying to put in a string? I don't know if you can do that.

If that is the case, then use an IF statement, but your earlier syntax was wrong. Try this...


=IIf(IsNull([Proposed Increase]),"No Increase",[Proposed Increase])


Good Luck

Rick B



Thanks, I didn't know such thing existed!

I have a different problem now. I get an error message saying that "Syntax error (comma) in query expression."

Any ideas?
_____
Rohn Everson
(712) 548-6900 (cell)
UOP email: (e-mail address removed)
Yahoo messenger: (e-mail address removed)
You could just use the built in function....



Nz([Proposed Increase],"No Increase")



I thought I could place a condition in the control source in my report! That if the field [Proposed Increase] is blank (Null) then populate the field with No Increase?

Although it does not work! I am guessing that the problem is me :-) Here is what I put in the form.

=IIf(Null,[Proposed Increase],'No Increase')

Thanks for any help you can provide!
_____
Rohn Everson
 
GREAT............ that worked!

But this gave me another idea! I have another database field that could be Null or 0 (zero). I tried this same formula in it and it doesn't work on that combination. Your on a roll, so I thought I would ask if you have any ideas for this one!

=IIf(IsNull([Safety_Stats]),"No Change",[Safety_Stats])

Thanks,

Rohn Everson
Hmmm. No idea. I think my syntax is correct. Wher I am using it, I have...

(Nz(UserID.OldValue, 0)


It may be because your field is a number and you are trying to put in a string? I don't know if you can do that.

If that is the case, then use an IF statement, but your earlier syntax was wrong. Try this...


=IIf(IsNull([Proposed Increase]),"No Increase",[Proposed Increase])


Good Luck

Rick B



Thanks, I didn't know such thing existed!

I have a different problem now. I get an error message saying that "Syntax error (comma) in query expression."

Any ideas?
_____
Rohn Everson
(712) 548-6900 (cell)
UOP email: (e-mail address removed)
Yahoo messenger: (e-mail address removed)
You could just use the built in function....



Nz([Proposed Increase],"No Increase")



I thought I could place a condition in the control source in my report! That if the field [Proposed Increase] is blank (Null) then populate the field with No Increase?

Although it does not work! I am guessing that the problem is me :-) Here is what I put in the form.

=IIf(Null,[Proposed Increase],'No Increase')

Thanks for any help you can provide!
_____
Rohn Everson
 
Your syntax is incorrect!

Try:

=IIf(IsNull([Proposed Increase])," = 'No Increase'","=[Proposed Increase]")

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com



I thought I could place a condition in the control source in my report! That if
the field [Proposed Increase] is blank (Null) then populate the field with No
Increase?

Although it does not work! I am guessing that the problem is me :-) Here is
what I put in the form.

=IIf(Null,[Proposed Increase],'No Increase')

Thanks for any help you can provide!
_____
Rohn Everson
 
=IIf(Nz([Safety_Stats],0)>0,[Safety_Stats],"No Change")

--
Reggie

----------
GREAT............ that worked!

But this gave me another idea! I have another database field that could be
Null or 0 (zero). I tried this same formula in it and it doesn't work on
that combination. Your on a roll, so I thought I would ask if you have any
ideas for this one!

=IIf(IsNull([Safety_Stats]),"No Change",[Safety_Stats])

Thanks,

Rohn Everson
Hmmm. No idea. I think my syntax is correct. Wher I am using it, I
have...

(Nz(UserID.OldValue, 0)


It may be because your field is a number and you are trying to put in a
string? I don't know if you can do that.

If that is the case, then use an IF statement, but your earlier syntax was
wrong. Try this...


=IIf(IsNull([Proposed Increase]),"No Increase",[Proposed Increase])


Good Luck

Rick B



Thanks, I didn't know such thing existed!

I have a different problem now. I get an error message saying that
"Syntax error (comma) in query expression."

Any ideas?
_____
Rohn Everson
(712) 548-6900 (cell)
UOP email: (e-mail address removed)
Yahoo messenger: (e-mail address removed)
You could just use the built in function....



Nz([Proposed Increase],"No Increase")



I thought I could place a condition in the control source in my
report! That if the field [Proposed Increase] is blank (Null) then populate
the field with No Increase?

Although it does not work! I am guessing that the problem is me :-)
Here is what I put in the form.

=IIf(Null,[Proposed Increase],'No Increase')

Thanks for any help you can provide!
_____
Rohn Everson
 
Back
Top