Adding a return in an expression builder.

  • Thread starter Thread starter emc
  • Start date Start date
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
 
Chr(13) & Chr(10) should give you a new line wherever it's used. How did you
attempt to use it?
 
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
 
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
 
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
 
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
 
Back
Top