IFF IsNull

yippie_ky_yay

Registered User.
Local time
Today, 09:09
Joined
Jul 30, 2002
Messages
338
Hello,

there's something I'm just not getting here when it comes to reports. I figured out the trim function without much problem to make FIRSTNAME LASTNAME TITLE all appear as one line, but now I'd like to enclose the TITLE in brackets - only, there isn't always a title.

I've seen some examples of:
=IFF (IsNull([TITLE]),"",[TITLE])

but this doesn't seem to work for me (I've tried putting them in the control source of the textbox and even assigning the the above statement like this:
txtTitle = IFF (IsNull([TITLE]),"",[TITLE])
in the Report_Load part).

Am I at least close?

Any help would be greatly appreciated!

-Sean
 
It's actually Iif, but simply enclosing the field name in brackets will not display the brackets, is that what you wish to do?
 
Thanks for replying Rich!

What I'd actually like is if TITLE is not null then display it with brackets around it (that part I can get, I just didn't want to overload you or any other reader with too much code).

Basicly, in the control source of a txtbox, I'd like to put:
=IFF(IsNull([TITLE]), "", "(" & [TITLE] & ")")

If I can get that to work, then I can worry about tacking it on the full name - soemthing like:
=Trim([FIRSTNAME] & " " & [LASTNAME] & " " & IFF(IsNull([TITLE]), "", "(" & [TITLE] & ")"))

Thanks!
 
It works!

I did it over - this time typing Iif instead of IIF (as Rich mentioned), and it seems to work fine now!?! I guess I'm used to VBA fixing my typos!

Thanks Rich!

-Sean
 
Is there a logic why Iif works but not IIF?
I kept ketting an error until i changed that, but it doesnt make sense why......
 

Users who are viewing this thread

Back
Top Bottom