Space

J

Justin

I need to remove any leading spaces from a text field.

I have " Coat"
I want "Coat"

I''ve tried Rtrim() and Cstr() with no luck. There must be a simple
function for this, but I can't find it.

Thanks.
 
D

Dirk Goldgar

Justin said:
I need to remove any leading spaces from a text field.

I have " Coat"
I want "Coat"

I''ve tried Rtrim() and Cstr() with no luck. There must be a simple
function for this, but I can't find it.


Um, did you try LTrim() ?

LTrim - trim spaces from the left of the string (leading spaces)
RTrim - trim spaces from the right of the string (trailing spaces)
Trim - trim leading and trailing spaces from the string

Using Access 2003, if I type Trim into the help box, the first topic I get
back is a summary of these functions, titled "Remove spaces from the
beginning and end of a text value".
 
J

Justin

Thank you, I'm an idiot.

Dirk Goldgar said:
Um, did you try LTrim() ?

LTrim - trim spaces from the left of the string (leading spaces)
RTrim - trim spaces from the right of the string (trailing spaces)
Trim - trim leading and trailing spaces from the string

Using Access 2003, if I type Trim into the help box, the first topic I get
back is a summary of these functions, titled "Remove spaces from the
beginning and end of a text value".

--
Dirk Goldgar, MS Access MVP
Access tips: www.datagnostics.com/tips.html

(please reply to the newsgroup)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top