Omit "Nickname" in concatenated field

  • Thread starter Thread starter Robin Chapple
  • Start date Start date
R

Robin Chapple

I have a database where [NickName] is used as the means of addressing
a member if the member is not commonly known by his formal
[FirstName].

In a report I need to include the [NickName] if it is different from
the [FirstName] and enclose it in curved brackets. I have used this
code and failed. It reads the " Iif ... Is Null" and omits the
brackets but still quotes the [NickName] when it is the same as the
[FirstName]

="Name: " & [FirstName] & IIf([NickName] Is Null Or
[Nickname]=[FirstName]," "," (" & [Nickname] & ")") & " " & [LastName]

Thanks,

Robin Chapple
 
Perhaps this:

="Name: " & [FirstName] & (IIf(Len([NickName] & "")=0 Or
[Nickname]=[FirstName],""," (" & [Nickname] & ")") & " " & [LastName]
 
How about:
="Name: " & IIf([NickName] Is Null Or [NickName]=[FirstName],[FirstName] & "
",[FirstName] & " (" & [NickName] & ") ") & [LastName]

Another approach would be code in the report's
 
Back
Top