You need to use the function Replace.
debasisdas
Posting Genius
6,872 posts since Feb 2007
Reputation Points: 666
Solved Threads: 434
Hi Jemz. Have not heard from you in some time now.:)
Use the trim function -
Text1.Text = Trim(Text1.Text)
Debasisdas code will look something like -
Text1.Text = Replace(Text1.Text," ","")
, which by the way is the best way to remove empty spaces....:)
You can also add the below code to a module and use it throughout your application -
'To a module add ----
Public Function StripOut(From as string, What as string) as string
Dim i as Integer
StripOut = From
for i = 1 to len(What)
StripOut = Replace(StripOut, mid$(What, i, 1), "")
next i
End Function
'In your form call it as in ----
Text1.Text = StripOut(" ", "")
AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
Why can you not use the replace function Jemz? If you look at the one line of code using "Replace" compared to Jhai's 7 lines of code, it only makes sense to use the replace function for added speed in your application.
@Jhai, nice alternative offered.:)
AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
Jemz, has this sort your problem?
If so, you know what to do.:)
AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350