Insert LineFeed in TextBox

A

Alan Z. Scharf

Hi,

Is there a way to force a linefeed in programmatically set text going to an
unbound textbox in a report.

Depending on the name of a product, I want theproduct name split over two
lines in a report textbox with CanGrow propert.

I tried inserting Chr(13), vbCR, and vbLf in the formula forming the text,
but that didn't work.

What I would like is the equivalent of ("XXX" & vbLf & "YYY")

Thanks.

Alan
 
D

Douglas J. Steele

In VBA, use vbCrLf

In a query (or anywhere else where the intrinsic constants aren't
recognized), use Chr(13) & Chr(10)
 
F

fredg

Hi,

Is there a way to force a linefeed in programmatically set text going to an
unbound textbox in a report.

Depending on the name of a product, I want theproduct name split over two
lines in a report textbox with CanGrow propert.

I tried inserting Chr(13), vbCR, and vbLf in the formula forming the text,
but that didn't work.

What I would like is the equivalent of ("XXX" & vbLf & "YYY")

Thanks.

Alan

In Access you must use the carriage return AND line feed character
(IN THAT ORDER).

In an unbound Access control:
="XXX" & chr(13) & chr10) & "YYY"

In VBA:
="XXX" & vbCrLf & "YYY"
or
="XXX" & vbCr & vbLf & "YYY"
or
="XXX" & vbNewLine & "YYY"
or
="XXX" & chr(13) & chr10) & "YYY"
 
D

Douglas J. Steele

fredg said:
In Access you must use the carriage return AND line feed character
(IN THAT ORDER).

In an unbound Access control:
="XXX" & chr(13) & chr10) & "YYY"

Slight correction:

="XXX" & chr(13) & chr(10) & "YYY"
 

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