Insert line break

G

Guest

Hi all,

is there any way i can insert a line break inside the text field on a report?

i want to inset it instead of " - " (but only in case there is one in the
field)

is it feasible?

Thanks for any help.
Lana
 
D

Duane Hookom

You might be able to use the replace function like:

=Replace([TextFieldOnAReport],"-", Chr(13) & Chr(10) )
 
C

Charles E. Vopicka

Lana said:
Hi all,

is there any way i can insert a line break inside the text field on a report?

i want to inset it instead of " - " (but only in case there is one in the
field)

is it feasible?

Thanks for any help.
Lana

if you have a VBCrLf that will give you a new line. it is the Visual
Basic - Carriage Return - Line Feed. the standard DOS based end of line
combination. so...


"Hello World" & VBCrLf & "how are you"


would yield...


Hello World
how are you


you could add characters like a tab for indents (chr(9))


hope this helps.

--
Charles E. Vopicka's (Chuck) : (e-mail address removed)

Database Management, GIS Specialist and Research Assistant

Forest Biometrics Research Institute
University of Montana - College of Forestry and Conservation
Missoula, MT 59812
United States of America

Phone:
(406)243-4526
(406)243-4264
(406)549-0647 (Home)

:) HAVE A NICE DAY (-:

"UNLESS" (The Lorax, by Dr. Seuss)
 
G

Guest

Hi Duane,

I put the code u've given me as follows, but it wouldnt work for my case... :(
=Replace([FileGroup1.Column(2)],"-",Chr(13) & Chr(10))
Seems it's because it is Column(2), because i tried with other fields - it
worked fine.
How can i fix it to work?
Lana


Duane Hookom said:
You might be able to use the replace function like:

=Replace([TextFieldOnAReport],"-", Chr(13) & Chr(10) )

--
Duane Hookom
MS Access MVP

Lana said:
Hi all,

is there any way i can insert a line break inside the text field on a
report?

i want to inset it instead of " - " (but only in case there is one in the
field)

is it feasible?

Thanks for any help.
Lana
 
C

Charles E. Vopicka

i noticed that you had " - " in your original post but the example you
used was "-" could it not be finding what you are looking for. a not so
nice solution might be


=if([TextFieldOnAReport]=" - ",vbcrlf,[TextFieldOnAReport])


i assume that is what replace would do for you as well. i am a bit
rusty on some of my commands.

Hi Duane,

I put the code u've given me as follows, but it wouldnt work for my case... :(
=Replace([FileGroup1.Column(2)],"-",Chr(13) & Chr(10))
Seems it's because it is Column(2), because i tried with other fields - it
worked fine.
How can i fix it to work?
Lana


Duane Hookom said:
You might be able to use the replace function like:

=Replace([TextFieldOnAReport],"-", Chr(13) & Chr(10) )

--
Duane Hookom
MS Access MVP

Lana said:
Hi all,

is there any way i can insert a line break inside the text field on a
report?

i want to inset it instead of " - " (but only in case there is one in the
field)

is it feasible?

Thanks for any help.
Lana


--
Charles E. Vopicka's (Chuck) : (e-mail address removed)

Database Management, GIS Specialist and Research Assistant

Forest Biometrics Research Institute
University of Montana - College of Forestry and Conservation
Missoula, MT 59812
United States of America

Phone:
(406)243-4526
(406)243-4264
(406)549-0647 (Home)

:) HAVE A NICE DAY (-:

"UNLESS" (The Lorax, by Dr. Seuss)
 
D

Duane Hookom

Lana,
I missed any mention earlier that this was a non-bound column of a list or
combo box. It looks like your []s are wrong. Did you try:
=Replace(FileGroup1.Column(2),"-",Chr(13) & Chr(10))

Charles,
You can't ever use constants like vbcrlf in control sources or anywhere
outside of modules.

--
Duane Hookom
MS Access MVP



Charles E. Vopicka said:
i noticed that you had " - " in your original post but the example you used
was "-" could it not be finding what you are looking for. a not so nice
solution might be


=if([TextFieldOnAReport]=" - ",vbcrlf,[TextFieldOnAReport])


i assume that is what replace would do for you as well. i am a bit rusty
Hi Duane,

I put the code u've given me as follows, but it wouldnt work for my
case... :(
=Replace([FileGroup1.Column(2)],"-",Chr(13) & Chr(10))
Seems it's because it is Column(2), because i tried with other fields -
it worked fine.
How can i fix it to work?
Lana


Duane Hookom said:
You might be able to use the replace function like:

=Replace([TextFieldOnAReport],"-", Chr(13) & Chr(10) )

--
Duane Hookom
MS Access MVP

Hi all,

is there any way i can insert a line break inside the text field on a
report?

i want to inset it instead of " - " (but only in case there is one in
the
field)

is it feasible?

Thanks for any help.
Lana


--
Charles E. Vopicka's (Chuck) : (e-mail address removed)

Database Management, GIS Specialist and Research Assistant

Forest Biometrics Research Institute
University of Montana - College of Forestry and Conservation
Missoula, MT 59812
United States of America

Phone:
(406)243-4526
(406)243-4264
(406)549-0647 (Home)

:) HAVE A NICE DAY (-:

"UNLESS" (The Lorax, by Dr. Seuss)
 
C

Charles E. Vopicka

oops sorry about that i have been digging through a plethora of modules
lately and it is just a force of habit. thanks for the correction.


Duane said:
Lana,
I missed any mention earlier that this was a non-bound column of a list or
combo box. It looks like your []s are wrong. Did you try:
=Replace(FileGroup1.Column(2),"-",Chr(13) & Chr(10))

Charles,
You can't ever use constants like vbcrlf in control sources or anywhere
outside of modules.


--
Charles E. Vopicka's (Chuck) : (e-mail address removed)

Database Management, GIS Specialist and Research Assistant

Forest Biometrics Research Institute
University of Montana - College of Forestry and Conservation
Missoula, MT 59812
United States of America

Phone:
(406)243-4526
(406)243-4264
(406)549-0647 (Home)

:) HAVE A NICE DAY (-:

"UNLESS" (The Lorax, by Dr. Seuss)
 
G

Guest

Thank you guys so much!
That one worked!
=Replace(FileGroup1.Column(2)," - ",Chr(13) & Chr(10))

PS: Is there any way to introduce here 2 conditions for replacement?
one for " - " and one for ": "

shall it be AND or OR operator? and where does it go in the syntax?

Lana


Duane Hookom said:
Lana,
I missed any mention earlier that this was a non-bound column of a list or
combo box. It looks like your []s are wrong. Did you try:
=Replace(FileGroup1.Column(2),"-",Chr(13) & Chr(10))

Charles,
You can't ever use constants like vbcrlf in control sources or anywhere
outside of modules.

--
Duane Hookom
MS Access MVP



Charles E. Vopicka said:
i noticed that you had " - " in your original post but the example you used
was "-" could it not be finding what you are looking for. a not so nice
solution might be


=if([TextFieldOnAReport]=" - ",vbcrlf,[TextFieldOnAReport])


i assume that is what replace would do for you as well. i am a bit rusty
Hi Duane,

I put the code u've given me as follows, but it wouldnt work for my
case... :(
=Replace([FileGroup1.Column(2)],"-",Chr(13) & Chr(10))
Seems it's because it is Column(2), because i tried with other fields -
it worked fine.
How can i fix it to work?
Lana


:

You might be able to use the replace function like:

=Replace([TextFieldOnAReport],"-", Chr(13) & Chr(10) )

--
Duane Hookom
MS Access MVP

Hi all,

is there any way i can insert a line break inside the text field on a
report?

i want to inset it instead of " - " (but only in case there is one in
the
field)

is it feasible?

Thanks for any help.
Lana


--
Charles E. Vopicka's (Chuck) : (e-mail address removed)

Database Management, GIS Specialist and Research Assistant

Forest Biometrics Research Institute
University of Montana - College of Forestry and Conservation
Missoula, MT 59812
United States of America

Phone:
(406)243-4526
(406)243-4264
(406)549-0647 (Home)

:) HAVE A NICE DAY (-:

"UNLESS" (The Lorax, by Dr. Seuss)
 
D

Duane Hookom

I'm not sure what you mean by "introduce here 2 conditions for replacement".
Perhaps you can just nest the Replace()
=Replace(Replace(FileGroup1.Column(2)," - ",Chr(13) & Chr(10)),": ", Chr(13)
& Chr(10))

--
Duane Hookom
MS Access MVP


Lana said:
Thank you guys so much!
That one worked!
=Replace(FileGroup1.Column(2)," - ",Chr(13) & Chr(10))

PS: Is there any way to introduce here 2 conditions for replacement?
one for " - " and one for ": "

shall it be AND or OR operator? and where does it go in the syntax?

Lana


Duane Hookom said:
Lana,
I missed any mention earlier that this was a non-bound column of a list
or
combo box. It looks like your []s are wrong. Did you try:
=Replace(FileGroup1.Column(2),"-",Chr(13) & Chr(10))

Charles,
You can't ever use constants like vbcrlf in control sources or anywhere
outside of modules.

--
Duane Hookom
MS Access MVP



Charles E. Vopicka said:
i noticed that you had " - " in your original post but the example you
used
was "-" could it not be finding what you are looking for. a not so nice
solution might be


=if([TextFieldOnAReport]=" - ",vbcrlf,[TextFieldOnAReport])


i assume that is what replace would do for you as well. i am a bit
rusty
on some of my commands.


Lana wrote:
Hi Duane,

I put the code u've given me as follows, but it wouldnt work for my
case... :(
=Replace([FileGroup1.Column(2)],"-",Chr(13) & Chr(10))
Seems it's because it is Column(2), because i tried with other
fields -
it worked fine.
How can i fix it to work?
Lana


:

You might be able to use the replace function like:

=Replace([TextFieldOnAReport],"-", Chr(13) & Chr(10) )

--
Duane Hookom
MS Access MVP

Hi all,

is there any way i can insert a line break inside the text field on
a
report?

i want to inset it instead of " - " (but only in case there is one
in
the
field)

is it feasible?

Thanks for any help.
Lana




--
Charles E. Vopicka's (Chuck) : (e-mail address removed)

Database Management, GIS Specialist and Research Assistant

Forest Biometrics Research Institute
University of Montana - College of Forestry and Conservation
Missoula, MT 59812
United States of America

Phone:
(406)243-4526
(406)243-4264
(406)549-0647 (Home)

:) HAVE A NICE DAY (-:

"UNLESS" (The Lorax, by Dr. Seuss)
 
G

Guest

Thank you, Duane! it worked!!!
Lana


Duane Hookom said:
I'm not sure what you mean by "introduce here 2 conditions for replacement".
Perhaps you can just nest the Replace()
=Replace(Replace(FileGroup1.Column(2)," - ",Chr(13) & Chr(10)),": ", Chr(13)
& Chr(10))

--
Duane Hookom
MS Access MVP


Lana said:
Thank you guys so much!
That one worked!
=Replace(FileGroup1.Column(2)," - ",Chr(13) & Chr(10))

PS: Is there any way to introduce here 2 conditions for replacement?
one for " - " and one for ": "

shall it be AND or OR operator? and where does it go in the syntax?

Lana


Duane Hookom said:
Lana,
I missed any mention earlier that this was a non-bound column of a list
or
combo box. It looks like your []s are wrong. Did you try:
=Replace(FileGroup1.Column(2),"-",Chr(13) & Chr(10))

Charles,
You can't ever use constants like vbcrlf in control sources or anywhere
outside of modules.

--
Duane Hookom
MS Access MVP



i noticed that you had " - " in your original post but the example you
used
was "-" could it not be finding what you are looking for. a not so nice
solution might be


=if([TextFieldOnAReport]=" - ",vbcrlf,[TextFieldOnAReport])


i assume that is what replace would do for you as well. i am a bit
rusty
on some of my commands.


Lana wrote:
Hi Duane,

I put the code u've given me as follows, but it wouldnt work for my
case... :(
=Replace([FileGroup1.Column(2)],"-",Chr(13) & Chr(10))
Seems it's because it is Column(2), because i tried with other
fields -
it worked fine.
How can i fix it to work?
Lana


:

You might be able to use the replace function like:

=Replace([TextFieldOnAReport],"-", Chr(13) & Chr(10) )

--
Duane Hookom
MS Access MVP

Hi all,

is there any way i can insert a line break inside the text field on
a
report?

i want to inset it instead of " - " (but only in case there is one
in
the
field)

is it feasible?

Thanks for any help.
Lana




--
Charles E. Vopicka's (Chuck) : (e-mail address removed)

Database Management, GIS Specialist and Research Assistant

Forest Biometrics Research Institute
University of Montana - College of Forestry and Conservation
Missoula, MT 59812
United States of America

Phone:
(406)243-4526
(406)243-4264
(406)549-0647 (Home)

:) HAVE A NICE DAY (-:

"UNLESS" (The Lorax, by Dr. Seuss)
 

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

Similar Threads


Top