I have attempted to format an imported text field to be a fixed length of 9 for some fields that contain spaces.
ex:
sub-id
56892
000056 78
0000A 123
I thought the Format(Trim([sub-id],"000000000") was great and have used it sucessfully in the past-or so I thought.
The format works great for the data that has leading spaces, but not at all for the spaces in the middle of the field. I've also tried the IIf(InStr([sub-id]," ",Left([sub-id],InStr([sub-id]))-1,(stuck at this point)) to get the space.
Any advice or ideas as to why the format is not working with the spaces in the middle of the field? Can anyone provide the format expression to correct this?
I'm ready to this field!!!
Thanks in advance-
C
ex:
sub-id
56892
000056 78
0000A 123
I thought the Format(Trim([sub-id],"000000000") was great and have used it sucessfully in the past-or so I thought.
The format works great for the data that has leading spaces, but not at all for the spaces in the middle of the field. I've also tried the IIf(InStr([sub-id]," ",Left([sub-id],InStr([sub-id]))-1,(stuck at this point)) to get the space.
Any advice or ideas as to why the format is not working with the spaces in the middle of the field? Can anyone provide the format expression to correct this?
I'm ready to this field!!!
Thanks in advance-
C