On Sun, 27 Feb 2005 22:19:03 -0800, Eddie's Bakery and Cafe' wrote:
> Hi, from my VBA code I am creating a dynamic control Label and Text Box. I
> need to force a "line feed" or "carriage return" in in the middle of the
> text. I tried adding a Chr(10) and Chr(13) value to the string but this did
> not work. For example,
>
> Dim foo As String
> foo = " some text "
> foo = foo + Chr (13) ' ASCII Carriage Return Char
> foo = foo + " some text"
> Me.TextBox.TEXT = foo
>
> This code does not work. Can someone provide a solution to this problem,
>
> Thanks,
In Access you must use the chr(13) & chr(10) combination
IN THAT ORDER.
= "Line 1." & chr(13) & chr(10) & "Line 2."
In VBA you can also use vbCrLf or vbNewLine.
[SomeControl] = "Line 1." & vbCrLf & "Line 2."
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
|