Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get rid of Automatic space in textbox 2

Status
Not open for further replies.

AuctionLamb

Programmer
Feb 16, 2005
65
ZA
Hi guys!!

Need some help over here.......I am using VB 6.

I have a textbox, and on that textbox I do a validation(must have 8 digits). When I type in for example "12345678" it does not save because it is longer than 8 digits. Then I have found that when I type in something it adds a space at the end automatically "12345678 " so the system see it as 9 characters.

Is there something in the properties menu that I have to set to take it out or not putting it in?

THANKS!!
 
Could you put a break in the code provided by Matt and see when it occurs?

then start looking up the call stack

Take Care

Matt
If at first you don't succeed, skydiving is not for you.
 
The Code HarleyQuinn gave me worked.

Private Sub Text1_GotFocus()
Text1.Text = Trim(Text1.Text)
End Sub

Thanks GUYS!!!!
 
Thanks for the star. Glad I/we could help.

For your own peace of mind it might still be worth finding out where in the code that you populate the box with the space, just to see how it is happening.

Cheers

HarleyQuinn
---------------------------------
Help us to help you,
read FAQ222-2244 before posting.
 
Auction Lamb; Thank you

HarleyQuinn said:
Thanks for the star. Glad I/we could help.

For your own peace of mind it might still be worth finding out where in the code that you populate the box with the space, just to see how it is happening.

I couldn't agree more


Take Care

Matt
If at first you don't succeed, skydiving is not for you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top