|
-
Oct 27th, 2005, 07:41 AM
#1
Thread Starter
Frenzied Member
[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:
Replace Text1.Text, vbCrLf, " ", 1, -1, vbTextCompare
Which obviously doesn't work, any help ?
Thanks.
-
Oct 27th, 2005, 07:48 AM
#2
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"
-
Oct 27th, 2005, 08:10 AM
#3
Thread Starter
Frenzied Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|