Removing carriage return and spaces in a field

ECEK

Registered User.
Local time
Today, 12:41
Joined
Dec 19, 2012
Messages
717
I'm really struggling with this.
My import data is a list of categories. A, A1, B, C, C2, Cx for Example.

I have a reference table with additional data
A = True
A1 = False
B = True

etc

The problem is that if there is a space or carriage return in the import data I can't reference it from my table. So whilst the data says "B" it is in fact "Bcarriage return" and I cant reference it


I have this at present but I need to be able to remove carriage returns too.

Code:
 IIf(Len([Field1])>0,(Trim(Replace([Field1]," ",""))))

Your help is always appreciated.
 
have you tried replacing the various iterations for carriage returns?
ie.- vbCrLf, chr(10),chr(13), etc
 
I found an answer to the carriage returns:

Replace(Replace(Nz([Field1],""),Chr(10),""),Chr(13),"")
 

Users who are viewing this thread

Back
Top Bottom