473,569 Members | 2,770 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 1358
"Graham Feeley" <gr***********@ optusnet.com.au wrote in message
news:45******** **************@ news.optusnet.c om.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.com wrote in message
news:45******** **@glkas0286.gr eenlnk.net...
"Graham Feeley" <gr***********@ optusnet.com.au wrote in message
news:45******** **************@ news.optusnet.c om.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.au wrote in message
news:45******** **************@ news.optusnet.c om.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
12729
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' or even why there could be a problem. here is the code ////////
5
33286
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. * JavaScript example: String.prototype.trim = function() { // Strip leading and trailing white-space
12
47554
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 "&nbsp;" char - the non breaking space. Can this be represented in a grep statement at
3
2734
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 have done something wrong here.... I've tried both of these... =Trim( & ) =Trim( &", "& )
11
5335
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 (strIn.Substring(410, 10).Trim = "") Then 'Something processed Else 'Something processed
7
4211
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 faster? Is there a general rule/opinion to prefere members over functions? Thanks for any hint.
22
9719
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 thought I'd change it to the VB ..NET method "String.Trim" but that throws an object exception. Which brings the question: is it compliant to use...
1
20655
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
2880
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 *trim(char *s) { char *begin,*end; begin = s;
8
3243
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 else replying to Kevin Smith's article, please *ignore* the Followup-To header and post only to the csharp group. Thanks.
0
7694
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7921
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7666
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5504
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5217
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3636
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2107
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1208
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
936
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.