PC Review


Reply
Thread Tools Rate Thread

Adding a "Linefeed" in a Label/Text Box

 
 
=?Utf-8?B?RWRkaWUncyBCYWtlcnkgYW5kIENhZmUn?=
Guest
Posts: n/a
 
      28th Feb 2005
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,
--
Eddie Eytchison
 
Reply With Quote
 
 
 
 
Jacco
Guest
Posts: n/a
 
      28th Feb 2005

"Eddie's Bakery and Cafe'" <(E-Mail Removed)> wrote in message
news:77A5E588-BD2D-453F-8431-(E-Mail Removed)...
> 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,
> --
> Eddie Eytchison


Try this:

foo = foo & Chr (13) ' ASCII Carriage Return Char




 
Reply With Quote
 
=?Utf-8?B?RWRkaWUncyBCYWtlcnkgYW5kIENhZmUn?=
Guest
Posts: n/a
 
      28th Feb 2005
Hi Jacco, I tried using the "&" but this did not work. Do you have another
suggestion?

Thanks for your help

"Jacco" wrote:

>
> "Eddie's Bakery and Cafe'" <(E-Mail Removed)> wrote in message
> news:77A5E588-BD2D-453F-8431-(E-Mail Removed)...
> > 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,
> > --
> > Eddie Eytchison

>
> Try this:
>
> foo = foo & Chr (13) ' ASCII Carriage Return Char
>
>
>
>
>

 
Reply With Quote
 
Mark
Guest
Posts: n/a
 
      28th Feb 2005
Try:
foo=foo & vbCrLf

"Eddie's Bakery and Cafe'" <(E-Mail Removed)> wrote in message
news:48A14085-7273-494E-AF97-(E-Mail Removed)...
> Hi Jacco, I tried using the "&" but this did not work. Do you have
> another
> suggestion?
>
> Thanks for your help
>
> "Jacco" wrote:
>
>>
>> "Eddie's Bakery and Cafe'" <(E-Mail Removed)> wrote in message
>> news:77A5E588-BD2D-453F-8431-(E-Mail Removed)...
>> > 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,
>> > --
>> > Eddie Eytchison

>>
>> Try this:
>>
>> foo = foo & Chr (13) ' ASCII Carriage Return Char
>>
>>
>>
>>
>>



 
Reply With Quote
 
fredg
Guest
Posts: n/a
 
      28th Feb 2005
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.
 
Reply With Quote
 
Tim Ferguson
Guest
Posts: n/a
 
      28th Feb 2005
=?Utf-8?B?RWRkaWUncyBCYWtlcnkgYW5kIENhZmUn?= <(E-Mail Removed)>
wrote in news:77A5E588-BD2D-453F-8431-(E-Mail Removed):

> Me.TextBox.TEXT = foo


You cannot access the Text property of a control (unless it has the focus).
Try

Me!textbox.Value = "foo" & vbCrLf & "foo again"


HTH


Tim F

 
Reply With Quote
 
David C. Holley
Guest
Posts: n/a
 
      1st Mar 2005
Actually try foo = foo + Chr(13) + Chr(10)


Jacco wrote:
> "Eddie's Bakery and Cafe'" <(E-Mail Removed)> wrote in message
> news:77A5E588-BD2D-453F-8431-(E-Mail Removed)...
>
>>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,
>>--
>>Eddie Eytchison

>
>
> Try this:
>
> foo = foo & Chr (13) ' ASCII Carriage Return Char
>
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding both a "click" url and a "view" url to a text link dgco Microsoft Frontpage 4 10th May 2009 09:26 PM
pivot table label adding "2" to the end of a label name =?Utf-8?B?Sm9obg==?= Microsoft Excel Discussion 1 23rd Oct 2007 01:44 PM
Adding a large "DRAFT" label to a report upon printing Tom Microsoft Access Reports 1 24th Mar 2007 03:49 AM
Express "return char" or "Linefeed" =?Utf-8?B?QmlsbCBTdHVyZGV2YW50?= Microsoft Access Form Coding 1 25th Feb 2005 07:48 PM
LineFeed/CariageReturn in Label Text dchendrickson Microsoft Access Forms 2 18th Oct 2003 12:10 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:42 AM.