The IIf() function is a modification of the If...Then...Else construct, allowing it to be used in situations, such as this one, where a single line is needed.
The syntax for IIF() is
IIf(expr, truepart, falsepart)
exp...Expression to be evaluated
truepart...If the expression evaluate to True, do this.
falsepart...If the expression evaluate to False do this.
In this case, that would be
=IIF(Nz([Department],"") = "", "", "Team Member of" & " " & [Department] & ", " & [Office])
The expression bit
Nz([Department],"") = ""
evaluates whether or not [Department] is Null or contains a Zero-Length String. If either of these conditions is True, Nz() returns a Zero-Length String, otherwise it returns the Value in [Department].
If the Expression evaluates to True, i.e. the [Department] Field is empty, the target Control is populated with a Zero-Length String.
If the Expression evaluates to False, i.e. the [Department] Field is populated, the target Control is populated using your formatting,
"Team Member of" & " " & [Department] & ", " & [Office]
Does this help?
Linq ;0)>
The problem with making anything foolproof...is that fools are so darn ingenious!
All posts/responses based on Access 2003/2007