trim function not working

krc777

Registered User.
Local time
Today, 01:43
Joined
Nov 29, 2005
Messages
70
So I did some searches and came up with 'perhaps the leading character is not a space, in which case TRIM would not work.

I placed this in my code
mplan = LTrim(rst.Fields("Service Bureau ID"))
Asc (Left(mplan, 1)) -- this was a 48 (in the lookup table a 0)

The situation is that the mplan has the right number of digits in a field length of 4 which is correct. Then when I try to insert this field into another db in the code, which also has a field length of 4, I get a leading, what appears to be a space, and the last digit is cut off.

I've also tried TRIM in the above code and in the INSERT line.:(
 
KRC,

I take it that you are moving a numeric field to a text field.

You could use the Format function:

Format(136, "0000") --> "0136"
Format(136, "####") --> "136"

Depends on what you want in the text field.

Wayne
 

Users who are viewing this thread

Back
Top Bottom