Adding a return in an expression builder

  • Thread starter Thread starter emc
  • Start date Start date
E

emc

I have the following code in an expression builder in a form:

=Trim([Prefix] & (" "+[First Name]) & (" "+[Middle Name]) & (" "+[Surname])
& (" "+[Name5]) & (" "+[Name6]) & (" "+[Name7]))

Until recently it was fine for it all to be on the one line. Now it is
required that there is a return placed between the names and addresses. I
noticed on a previous thread that Chr(13) & Chr(10) be used on an IIF
expression. I've tried it on my epxression but it doesn't seem to work or
perhaps I'm doing something wrong.

Any help on this topic would be much appreciated.

emc
 
What Addresses? You might try something like the following.

=Trim([Prefix] & (" "+[First Name]) & (" "+[Middle Name])
& (" "+[Surname])
& (Chr(13) + Chr(10)) + ([Name5] & (" " + [Name6]) & (" " + [Name7])))



'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
 
John,

My apologies. I moved this to the form forum as it related to a form and
forgot to mention it in the reports forum. Sorry. I received a reply and
have now managed to create what I was looking for which is exactly what you
have given me.

Many thanks.

emc

John Spencer said:
What Addresses? You might try something like the following.

=Trim([Prefix] & (" "+[First Name]) & (" "+[Middle Name])
& (" "+[Surname])
& (Chr(13) + Chr(10)) + ([Name5] & (" " + [Name6]) & (" " + [Name7])))



'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
'====================================================

I have the following code in an expression builder in a form:

=Trim([Prefix] & (" "+[First Name]) & (" "+[Middle Name]) & (" "+[Surname])
& (" "+[Name5]) & (" "+[Name6]) & (" "+[Name7]))

Until recently it was fine for it all to be on the one line. Now it is
required that there is a return placed between the names and addresses. I
noticed on a previous thread that Chr(13) & Chr(10) be used on an IIF
expression. I've tried it on my epxression but it doesn't seem to work or
perhaps I'm doing something wrong.

Any help on this topic would be much appreciated.

emc
 
Back
Top