View Single Post
  #5  
Old June 3rd, 2010, 08:37 PM posted to microsoft.public.access.reports
Steve[_77_]
external usenet poster
 
Posts: 1,017
Default Firstname plus Middlename??

Duane's expression will give a space after the name if there is no middle
name. The expression should be:
=[surname] & ", " & [firstname] + (" " & [middlename])

When the plus sign is followed by parantheses, if anything is null inside
the parantheses the whole value inside the parantheses becomes null. Thus,
if there is no middle name, the string ends at firstname and there is no
trailing space.

Steve


"Duane Hookom" wrote in message
...
Try
=[surname] & ", " & [firstname] & " " + [middlename]

--
Duane Hookom
Microsoft Access MVP

NOTE: These public News Groups are ending June 1st. Consider asking
questions at
http://social.answers.microsoft.com/...ddbuz/threads?


"KG" wrote:

Apologies if this is a silly question. I'm trying to combine Lastname,
Firstname Middlename in a report. I have
=([surname]+", "+[firstname]+" "+[middlename]).
The only time it works is if all three fields contain values. As the
majority of players don't have middle names in the database, most of the
report is blank.
Can anyone tell me what I'm doing wrong?
Thanks so much for your help.
Kind regards...