Adding a return in an expression builder

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
 
J

John Spencer

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
'====================================================
 
E

emc

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top