A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Leading spaces



 
 
Thread Tools Display Modes
  #1  
Old December 7th, 2006, 04:22 AM posted to microsoft.public.access.forms
Chris Emery
external usenet poster
 
Posts: 2
Default Leading spaces

What is a good way to prevent leading spaces being entered in a name? I
know I can do a LTrim update query afterwards but I thought there might be
an easier way at the data entry form stage.

Chris in Canberra, Australia.


  #2  
Old December 7th, 2006, 04:41 AM posted to microsoft.public.access.forms
Arvin Meyer [MVP]
external usenet poster
 
Posts: 4,231
Default Leading spaces

Sure, do an LTrim in the control's AfterUdate event. Something like:

Sub txtControlName_AfterUpdate()
Me.txtControlName = LTrim(Me.txtControlName)
End Sub
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

"Chris Emery" wrote in message
...
What is a good way to prevent leading spaces being entered in a name? I
know I can do a LTrim update query afterwards but I thought there might be
an easier way at the data entry form stage.

Chris in Canberra, Australia.



  #3  
Old December 7th, 2006, 06:33 AM posted to microsoft.public.access.forms
Chris Emery
external usenet poster
 
Posts: 2
Default Leading spaces

Thanks Arvin, works perfectly.

"Arvin Meyer [MVP]" wrote in message
...
Sure, do an LTrim in the control's AfterUdate event. Something like:

Sub txtControlName_AfterUpdate()
Me.txtControlName = LTrim(Me.txtControlName)
End Sub
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

"Chris Emery" wrote in message
...
What is a good way to prevent leading spaces being entered in a name? I
know I can do a LTrim update query afterwards but I thought there might
be an easier way at the data entry form stage.

Chris in Canberra, Australia.





 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:12 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.