Adding a return in an expression builder.

E

emc

Apologies, I placed this in the reports section by mistake.

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
 
D

Douglas J. Steele

Chr(13) & Chr(10) should give you a new line wherever it's used. How did you
attempt to use it?
 
E

emc

In between, ie

=Trim([Prefix] Chr(13) & Chr(10) (" "+[First Name])...

Douglas J. Steele said:
Chr(13) & Chr(10) should give you a new line wherever it's used. How did you
attempt to use it?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


emc said:
Apologies, I placed this in the reports section by mistake.

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
 
E

emc

Doug,

I've managed to sort it. I did not have a closing parenthisis.

Many thanks.

emc

Douglas J. Steele said:
Chr(13) & Chr(10) should give you a new line wherever it's used. How did you
attempt to use it?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


emc said:
Apologies, I placed this in the reports section by mistake.

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
 
D

Douglas J. Steele

Glad you solved it. You were actually missing a couple of ampersands in what
you posted.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


emc said:
Doug,

I've managed to sort it. I did not have a closing parenthisis.

Many thanks.

emc

Douglas J. Steele said:
Chr(13) & Chr(10) should give you a new line wherever it's used. How did
you
attempt to use it?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


emc said:
Apologies, I placed this in the reports section by mistake.

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
 
E

emc

I noticed that also. Knowing I was on the right track made me play about
with it for a while to get it right.

Thanks again.

emc

Douglas J. Steele said:
Glad you solved it. You were actually missing a couple of ampersands in what
you posted.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


emc said:
Doug,

I've managed to sort it. I did not have a closing parenthisis.

Many thanks.

emc

Douglas J. Steele said:
Chr(13) & Chr(10) should give you a new line wherever it's used. How did
you
attempt to use it?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Apologies, I placed this in the reports section by mistake.

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