MS Access 2000 - remove white space when Trim() does not work
Posted on 2005-04-22
I want to be able to remove a leading white space. My data has come from the internet and is in the form of a date (just the year) in an Excel spreadsheet. I've tried using Trim() but without success. I've had this problem before and the piece of code that worked in that context was:
sPartnerCntry = vData(n, 1)
'strip off initial space (not an ordinary space, not in all files)
If Left$(sPartnerCntry, 1) = Chr$(160) Then
sPartnerCntry = Right$(sPartnerCntry, Len(sPartnerCntry) - 1)
This is a very specific solution which only works in one context, I would like a generalised expression which will strip any kind of white space from before or after a string.
The data I'm importing is a mixture of strings and integers.
Can anybody help?