Hi all,
I am looking for help with a field in a database that some people like to
enter a space before a name into it.
I know that the code If KeyAscii = vbspace then keyascii = 0 omits spaces
but I only want the first space eliminated in case they enter one.
The spaces causes havoc when searching.
Thanks in advance to any one that can assist me.
JT
Benjamins - 25 Mar 2008 11:02 GMT
Hi,
You can try the trim(string) and it will trim off any space infront as well
as behind.
>Hi all,
>I am looking for help with a field in a database that some people like to
[quoted text clipped - 5 lines]
>
>JT
Arvin Meyer [MVP] - 25 Mar 2008 14:08 GMT
The Trim() function will do what you wish. LTrim() will eliminate any
leading spaces so:
Private Sub MyTextbox_AfterUpdate()
Me.MyTextbox = LTrim(Me.MyTextbox)
End Sub

Signature
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
> Hi all,
> I am looking for help with a field in a database that some people like to
[quoted text clipped - 5 lines]
>
> JT