Inserting a Carriage Return in a Textbox

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • aw

    Inserting a Carriage Return in a Textbox

    Hi MVP's,

    I have a VB expression that inserts text in a report's textbox:

    (code in report's On-Active)

    If not isnull(forms!my form!subject1) then
    TextBox = "John Doe"
    End If

    How do I insert a carriage return into the textbox using VB? I would like
    to feed multiple lines into the textbox so that my output ends like this:

    John Doe
    Addres1 #101
    Tallahasee, MD 0000


    Any information will be greatly appreciated...


    --
    Thanks a million!
  • Harold

    #2
    Re: Inserting a Carriage Return in a Textbox

    Me!Mytextbox = "John Doe" & Chr(10) & Chr(13) & "Address1 #101" _
    & Chr(10) & Chr(13) & "Tallahasee , MD 0000"


    --
    PC Datasheet
    Your Resource For Help With Access, Excel And Word Applications
    resource@pcdata sheet.com


    "aw" <aw@spam.is.nul > wrote in message
    news:4e4a77862e 1b7a3e0d3de506c 2e50e82@news.1u senet.com...[color=blue]
    > Hi MVP's,
    >
    > I have a VB expression that inserts text in a report's textbox:
    >
    > (code in report's On-Active)
    >
    > If not isnull(forms!my form!subject1) then
    > TextBox = "John Doe"
    > End If
    >
    > How do I insert a carriage return into the textbox using VB? I would like
    > to feed multiple lines into the textbox so that my output ends like this:
    >
    > John Doe
    > Addres1 #101
    > Tallahasee, MD 0000
    >
    >
    > Any information will be greatly appreciated...
    >
    >
    > --
    > Thanks a million![/color]


    Comment

    • Kevin Hayes

      #3
      Re: Inserting a Carriage Return in a Textbox

      aw wrote:

      [color=blue]
      > Any information will be greatly appreciated...
      >[/color]

      Oddly enough, I'm an Access newbie that was looking for the same answer.
      I found it this morning.

      Use
      & Chr(13) & Chr(10) &

      between your fields and it will insert the carriage returns. I ended up
      googling this newsgroup on groups.google.c om to find the answer. I
      couldn't find it in Access' "help" anywhere.

      Comment

      • Fred Zuckerman

        #4
        Re: Inserting a Carriage Return in a Textbox

        I like vbCrLf instead of the CHR() functions.

        TextBox = "John Doe" & vbCrLf & _
        "Addres1 #101" & vbCrLf & _
        "Tallahasee , MD 0000"

        Fred Zuckerman

        "aw" <aw@spam.is.nul > wrote in message
        news:4e4a77862e 1b7a3e0d3de506c 2e50e82@news.1u senet.com...[color=blue]
        > Hi MVP's,
        >
        > I have a VB expression that inserts text in a report's textbox:
        >
        > (code in report's On-Active)
        >
        > If not isnull(forms!my form!subject1) then
        > TextBox = "John Doe"
        > End If
        >
        > How do I insert a carriage return into the textbox using VB? I would like
        > to feed multiple lines into the textbox so that my output ends like this:
        >
        > John Doe
        > Addres1 #101
        > Tallahasee, MD 0000
        >
        >
        > Any information will be greatly appreciated...
        >
        >
        > --
        > Thanks a million![/color]


        Comment

        • Rich P

          #5
          Re: Inserting a Carriage Return in a Textbox

          In a Standard Module

          Public strName As String, strAddr1 As String, strAddr2 As String

          Somewhere
          strName = "John Doe"
          strAddr1 = "123 1st St."
          strAddr2 = "Su City, IO"

          If not isnull(forms!my form!subject1) then
          TextBox = strName & vbCrLf & strAddr1 & vbCrLf & strAddr2
          End If


          Rich

          *** Sent via Developersdex http://www.developersdex.com ***
          Don't just participate in USENET...get rewarded for it!

          Comment

          • aw

            #6
            Re: Inserting a Carriage Return in a Textbox



            Thank you all for your answers...

            Comment

            Working...