Adding carriage returns to textboxes in a report (A2000)

M

Mark

I have a report that has a text box with this control
source:
=IIf([GrillsYesNo]="Yes",[cwGrillStyle] & [cwGrillBars] &
[cwGrillColor],"None")
This text box's Can Grow = True.
What I would like to do is add a carriage return between
cwGrillStyle and cwGrillBars, and between cwGrillBars and
cwGrillColor. I don't want to use separate textboxes for
each field, because if there are no Grills (GrillsYesNo
= "No", then I don't want the extra blank rows. I have
tried using vbCrLf, but Access assumes that this is a
field name, and I tried chr(13), and it just gives me a
small square inbetween my fields. Any ideas would be
greatly appreciated.


---Mark
 
R

Rick Brandt

Mark said:
I have a report that has a text box with this control
source:
=IIf([GrillsYesNo]="Yes",[cwGrillStyle] & [cwGrillBars] &
[cwGrillColor],"None")
This text box's Can Grow = True.
What I would like to do is add a carriage return between
cwGrillStyle and cwGrillBars, and between cwGrillBars and
cwGrillColor. I don't want to use separate textboxes for
each field, because if there are no Grills (GrillsYesNo
= "No", then I don't want the extra blank rows. I have
tried using vbCrLf, but Access assumes that this is a
field name, and I tried chr(13), and it just gives me a
small square inbetween my fields. Any ideas would be
greatly appreciated.

You need both Chr(13) & Chr(10)
(in that order)
 
M

Mark

Thanks a lot, Rick. That worked great.

Just for curiousity's sake, why do i need both chr(13) and
chr(10) to get a carriage return?
 
R

Rick Brandt

Mark said:
Thanks a lot, Rick. That worked great.

Just for curiousity's sake, why do i need both chr(13) and
chr(10) to get a carriage return?

Most windows files need both a Carriage Return (13) and a LineFeed (10) to
start a new line. Other systems only use one or the other usually (10).
 
M

Mark

Thanks for the info. I didn't realize that (13) was
Carriage return and (10) was line feed. I had always
assumed that they were interchangeable. Thanks again.


--Mark

Original Message:
 

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