Re: Text Functions
From: Kirk P. (KirkP_at_discussions.microsoft.com)
Date: 03/02/05
- Next message: Richard: "Re: Do I need an Union Query for this?"
- Previous message: John Vinson: "Re: Importing Data from Multiple Access Tables into One Table"
- In reply to: MGFoster: "Re: Text Functions"
- Next in thread: John Spencer (MVP): "Re: Text Functions"
- Reply: John Spencer (MVP): "Re: Text Functions"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 2 Mar 2005 13:15:36 -0800
The function runs, but returns the same text string that I started with. I
have determined that the space is ALWAYS the first character. I would think
the Trim or LTrim function would remove it, but it does not.
Any other ideas? There is definately a space before the first character.
"MGFoster" wrote:
> Kirk P. wrote:
> > Is there a function to remove spaces within a text field?
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> There isn't a built-in one. Try this:
>
> Function NoSpaces(ByVal s As String) As String
>
> Const WHITESPACE = " "
>
> s = Trim$(s)
>
> Dim p As Long
> p = InStr(s, WHITESPACE)
> Do While p > 0
> s = Left$(s, p - 1) & Mid$(s, p + 1)
> p = InStr(p, s, WHITESPACE)
> Loop
>
> NoSpaces = s
>
> End Function
>
>
>
> --
> MGFoster:::mgf00 <at> earthlink <decimal-point> net
> Oakland, CA (USA)
>
> -----BEGIN PGP SIGNATURE-----
> Version: PGP for Personal Privacy 5.0
> Charset: noconv
>
> iQA/AwUBQiYmQYechKqOuFEgEQK2fwCgom0kccXof542/iDl4WUxG1inl/gAoNFz
> zok80z7tPp2+Ero3V5l3Dr4r
> =IxoP
> -----END PGP SIGNATURE-----
>
- Next message: Richard: "Re: Do I need an Union Query for this?"
- Previous message: John Vinson: "Re: Importing Data from Multiple Access Tables into One Table"
- In reply to: MGFoster: "Re: Text Functions"
- Next in thread: John Spencer (MVP): "Re: Text Functions"
- Reply: John Spencer (MVP): "Re: Text Functions"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|