Results 1 to 3 of 3

Thread: [RESOLVED] Problem replacing new lines...

  1. #1

    Thread Starter
    Frenzied Member thegreatone's Avatar
    Join Date
    Aug 2003
    Location
    Oslo, Norway. Mhz:4800 x12
    Posts
    1,333

    Resolved [RESOLVED] Problem replacing new lines...

    Hello all, i thought this would be the easiest thing to do ever, i was wrong, all i want to do is replace new lines in a textbox with " " don't tell me to turn multi-line off please, i already tried that. Well, if you can supply some word wrapping code so it doesn't scroll out of view then go ahead.

    Anyways, i have the following code called in a Command Button -
    VB Code:
    1. Replace Text1.Text, vbCrLf, " ", 1, -1, vbTextCompare
    Which obviously doesn't work, any help ?

    Thanks.
    Zeegnahtuer?

  2. #2
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: Problem replacing new lines...

    does VB give u an error?
    the format to use Replace() is like this...

    Text1 = Replace(Text1,vbcrlf," ")

    you could add the vbTextCompare but in this case its not needed since there is no Upper/Lower case of vbCrLf it will find them
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  3. #3

    Thread Starter
    Frenzied Member thegreatone's Avatar
    Join Date
    Aug 2003
    Location
    Oslo, Norway. Mhz:4800 x12
    Posts
    1,333

    Re: Problem replacing new lines...

    I knew i'd forgotten something, i usually start my coding off with "Option Explicit" today (well 3am last night) it seems i have forgotten it...

    That should work, testing now

    Works like a dream, cheers mate, Option Explicit also added to my coding, i recommend it
    Zeegnahtuer?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width