Just taking a wild stab at it, how about using the LostFocus event of the
text box. In the Event enter the code something similar to this:
(Assuming the Text Box's name is "TextBox")
-----------------------
Private Sub TextBox_LostFocus()
Dim strContents
strContents = Trim(TextBox.text)
TextBox.text = strContents
End Sub
-----------------------
I suppose you could do it without the variable, but I like using the
variable...
---------------------
Private Sub TextBox_LostFocus()
TextBox.text = Trim(TextBox.text)
End Sub
---------------------
You could also use this Sub to do other content and error checking as well.
You could also keep this in a Function or Sub and include the code to do
that same to all the controls on the form. You would Call it from an Event
at the Form level like maybe the LostFocus event of the form. Just a
thought...
--
Phillip Windell [MCP, MVP, CCNA]
www.wandtv.com
-----------------------------------------------------
Understanding the ISA 2004 Access Rule Processing
http://www.isaserver.org/articles/ISA2004_AccessRules.html
Microsoft Internet Security & Acceleration Server: Guidance
http://www.microsoft.com/isaserver/techinfo/Guidance/2004.asp
http://www.microsoft.com/isaserver/techinfo/Guidance/2000.asp
Microsoft Internet Security & Acceleration Server: Partners
http://www.microsoft.com/isaserver/partners/default.asp
Deployment Guidelines for ISA Server 2004 Enterprise Edition
http://www.microsoft.com/technet/prodtechnol/isa/2004/deploy/dgisaserver.mspx
-----------------------------------------------------
Jose Aleman said:
When I copy and paste the information onto excel, I have to mannually remove
any space at the end of the sentence. That's what i'm trying to accomplish.
Remove any space after the end of the sentence.
Jerry Whittle said:
The Trim() Function should remove both leading and trailing spaces. LTrim
removes just the leading spaces while RTrim removes only trailing spaces.
Please describe what you mean by "but it's not working" in detail.
--
Jerry Whittle
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.
:
Hi,
I have a field named except_desc1. Some user enter space after a
description and I want to remove those spaces before entering them in excel.
I used the following function but it's not working.
TRIM([except_desc1]) AS Except_Desc1
Please advice if i'm suppose to use the Right or Left function
instead.