Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formatting Names 1

Status
Not open for further replies.

MisterC

IS-IT--Management
Apr 19, 2001
501
US
I'm trying to concatenate Last name, First Name, & Middle Initial.
Like: [LName], [FName], [MI].
...but I don't want the period after [MI] to show if there is no [MI].
This is what I have:
=[LName] & ", " & [FName] & " " & [MI] & "."

Isn't there an easy way to specify the "." is optional if [MI] is null? (Without using iif([MI]="","","."))

Thanks!
 
Hi!

Try:

[tt]=[LName] & ", " & [FName] & " " [highlight cyan]+[/highlight] [MI] [highlight cyan]+[/highlight] "."[/tt]

Roy-Vidar
 
Thanks RoyVidar, that did the trick.
Can you explain exactly how the + functions?
 
No, not really;-)

Just picked it up here some time ago, and am rather happy for reducing the amount of code on my reports.

Would be enough with only the last one though. It seems when a control is null, there's some arithmetic causing the next control/expression/value not to display (Null + "Something" -> Null, whilst Null & "Something" -> "Something")

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top