Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / March 2008

Tip: Looking for answers? Try searching our database.

No space in front of Name

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JayTee - 25 Mar 2008 10:28 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.