IIF BLANK TEXT BOX ISSUE

I have an ADP database that when a value is coming up blank the IIF statement does not work correctly.  For example:

Control Source
=IIF([Rate]="",0[Rate])
 The textbox is still blank.  Any idea?
InvisibleManAsked:
Who is Participating?
 
PsychoDazeyConnect With a Mentor Commented:
I would use the Nz function.  I think this is what you are trying to do:
Me![Rate].Control Source = Nz(Me.[Rate],0)
0
 
PaurthsCommented:
hi InvisibleMan,

try this:

=IIf(IsNull([rate]);0;[rate])

cheers
Ricky
0
 
chuck_forbesCommented:
or

=IIf(IsNull([rate]) Or Trim([rate] = "");0;[rate])

-cf
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
hnasrCommented:
PsychoDazey, Just put the control source property:
=Nz(Me.[Rate],0)  
:)
0
 
PsychoDazeyCommented:
That is what I dis hsanr (refer to my comment above yours)?!?!?  Did you mean to refer that comment to InvisibleMan?
0
 
hnasrCommented:
PsychoDazey ,
I was referring to your comment, which is now accepted answer, to remove: Me![Rate].Control Source before the equal sign. :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.