Iif statement is erroring

M

MeSteve

=IIf([Completed]=-1,[ClosedName],[ProjectNameShort])

Works if true, errors if false. The field exists in the source query and is
spelled correctly. What am I missing?
 
G

Golfinray

If completed, closedname, and projectnameshort are text you need to put them
in quotes. ["completed"], etc
 
J

John W. Vinson

=IIf([Completed]=-1,[ClosedName],[ProjectNameShort])

Works if true, errors if false. The field exists in the source query and is
spelled correctly. What am I missing?

What's the datatype of [Completed]? Might it be NULL? What's the context -
where are you using this expression? What error are you getting? Help please!
 
Top