473,503 Members | 1,677 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Trim????

Hi I have a text field called FName.
Records looks like this

8 Kingston
10 Wilston
I would like to delete all from the left including the space

Result
Kingston
Wilston

Any help would be appreciated
Graham

Nov 23 '06 #1
3 1355
"Graham Feeley" <gr***********@optusnet.com.auwrote in message
news:45**********************@news.optusnet.com.au ...
Hi I have a text field called FName.
Records looks like this

8 Kingston
10 Wilston
I would like to delete all from the left including the space

Result
Kingston
Wilston

Any help would be appreciated
Graham
Paste this into a module:

Public Function libTrim(str As String) As String

Dim intStart As Integer
intStart = InStr(str, " ")
libTrim = Right(str, Len(str) - intStart)

End Function

Call it from a query based on your table:

Expr1: libTrim([FName])

HTH - Keith.
www.keithwilby.com
Nov 23 '06 #2
Well Thank you very much Keith, worked a charm.
I spent hours searching for code to do it so I gave up and posted here.
Very fast reply I must say , probably was there only half an hour
Appreciate it and have bookmarked your Website
Regards
Graham

"Keith Wilby" <he**@there.comwrote in message
news:45**********@glkas0286.greenlnk.net...
"Graham Feeley" <gr***********@optusnet.com.auwrote in message
news:45**********************@news.optusnet.com.au ...
>Hi I have a text field called FName.
Records looks like this

8 Kingston
10 Wilston
I would like to delete all from the left including the space

Result
Kingston
Wilston

Any help would be appreciated
Graham

Paste this into a module:

Public Function libTrim(str As String) As String

Dim intStart As Integer
intStart = InStr(str, " ")
libTrim = Right(str, Len(str) - intStart)

End Function

Call it from a query based on your table:

Expr1: libTrim([FName])

HTH - Keith.
www.keithwilby.com

Nov 23 '06 #3
"Graham Feeley" <gr***********@optusnet.com.auwrote in message
news:45**********************@news.optusnet.com.au ...
Well Thank you very much Keith, worked a charm.
I spent hours searching for code to do it so I gave up and posted here.
Very fast reply I must say , probably was there only half an hour
Appreciate it and have bookmarked your Website
Regards
Graham
My pleasure, glad I could help.

Regards,
Keith.
Nov 23 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

22
12718
by: Simon | last post by:
Hi, I have written a function to trim char *, but I have been told that my way could be dangerous and that I should use memmove(...) instead. but I am not sure why my code could be 'dangerous'...
5
33269
by: Alex Vassiliev | last post by:
Hi all. Just wanted to share two handy RegEx expressions to strips leading and trailing white-space from a string, and to replace all repeated spaces, newlines and tabs with a single space. *...
12
47476
by: Robert Mark Bram | last post by:
Hi All, I am using the following trim function: function trim (str) { return str.replace(/^\s*/g, '').replace(/\s*$/g, ''); } The problem is that this doesn't trim instances of the...
3
2725
by: FlyerN87 | last post by:
For some reason this command will not trim the names shown in the fields listed. I'm trying to do this in a text box on a report. I've done this fairly succesfully in other reports but I must...
11
5325
by: Darren Anderson | last post by:
I have a function that I've tried using in an if then statement and I've found that no matter how much reworking I do with the code, the expected result is incorrect. the code: If Not...
7
4196
by: Sascha Herpers | last post by:
Hi, what is the difference between the trim function and the trim String-member? As far as I see it, both return the trimmed string and leave the original string unaltered. Is any of the two...
22
9696
by: Terry Olsen | last post by:
I have an app that makes decisions based on string content. I need to make sure that a string does not contain only spaces or newlines. I am using the syntax 'Trim(String)" and it works fine. I...
1
20636
by: arsaral | last post by:
Hi, Here is an extension of MSDN's trim right example to trim left-right... First subroutines then the calling structure is given below... Cheers. Ali Riza SARAL ...
31
2863
by: rkk | last post by:
Hi, I've written a small trim function to trim away the whitespaces in a given string. It works well with solaris forte cc compiler, but on mingw/cygwin gcc it isn't. Here is the code: char...
8
3230
by: Keith Thompson | last post by:
Kevin Smith <no@spam.comwrites: You posted this to microsoft.public.dotnet.languages.csharp, where I presume it's topical. Why on Earth did you redirect followups to comp.lang.c? Anyone...
0
7084
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7278
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6991
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7458
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5013
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3167
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3154
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
380
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.