IIF Error in Report Textbox

Sorrells

Registered User.
Local time
Today, 15:09
Joined
Jan 13, 2001
Messages
258
[Access 97] I hate to add this thread as it should be so simple and I must just be missing something, but an hour is a long time to be beating one's head against the proverbial Access wall!

I want the field Home_Phone to be displayed in the report if it has data and not if it does not. This is in the detail section. My IIF statement is accepted by Access but displays #Error in the report preview.

The statement is:

=IIf(IsNull([Office_Phone]),"",[Office_Phone])

or what I originally wanted:

=IIF(not IsNull(Office_Phone),"Office Phone: " & [Office_Phone]."")

I am looking forward to a response that shows how I am missing the point here. It just can't be that difficult!
 
There are brackets missing in the not IsNull statement
IIF(not IsNull([Office_Phone]),"Office Phone: " & [Office_Phone]."")
The first one serves no purpose
 
Rich,

My error with the brackets, they were in the program, I was recopying from memory [faulty :)]

The first IIF statement is in a report control, or would be if it worked so that if there were no data in the control source field, was more complex but both returned the error in preview.

My intent was to include the label in the control if there was data and nothing if not. So the statement was:

IIF(IsNull[Office_Phone]),"","Office: " & [Office_Phone])

I thought I could save myself from having to hide the label and make formatting a little easier. But, it does not work for some reason.

I appreciate your response. What do you think now?
 

Users who are viewing this thread

Back
Top Bottom