how come my memo field in access always trims the trailing spaces? acccess 97.

K

Ken Snell

Short answer:

that is how ACCESS is designed for all fields. Trailing spaces are
automatically trimmed when being stored into a field.
 
J

James

is there a workaround?


Ken Snell said:
Short answer:

that is how ACCESS is designed for all fields. Trailing spaces are
automatically trimmed when being stored into a field.
 
K

Ken Snell

None to my knowledge. What are you trying to achieve? Perhaps there's
another way to approach your desired result.

--
Ken Snell
<MS ACCESS MVP>

James said:
is there a workaround?
 
J

James

my users use spaces to align their text manualy. we have a multiline
textobx field that defaults alignment to center, if they want to put
somthing a little to the left they need to add a bunch of spaces.
 
K

Ken Snell

Perhaps changing the textbox to left aligned and then inserting preceding
spaces will work for you? ACCESS does not trim those spaces.
 
T

TC

Maybe better to say for "controls", not "fields"? As I'm sure you know, Jet
is quite happy to store trailing spaces in fields.

Cheers,
TC


Ken Snell said:
Short answer:

that is how ACCESS is designed for all fields. Trailing spaces are
automatically trimmed when being stored into a field.
 
K

Ken Snell

Trailing spaces are deleted in my databases when I type directly into a
field in a table (no form used).

--
Ken Snell
<MS ACCESS MVP>

TC said:
Maybe better to say for "controls", not "fields"? As I'm sure you know, Jet
is quite happy to store trailing spaces in fields.

Cheers,
TC
 
T

Tim Ferguson

Trailing spaces are deleted in my databases when I type directly into a
field in a table (no form used).

yesbut -- using an

INSERT INTO MyTable (MyID, MyText)
VALUES(1, "Watch this space ")

is honoured. That's why it's an Access problem, not a Jet one.

B Wishes


Tim F
 
J

James

because most of the text needs to be centered.


Ken Snell said:
Perhaps changing the textbox to left aligned and then inserting preceding
spaces will work for you? ACCESS does not trim those spaces.
 
J

James

the rich textbox control that is aligned center acts funny. When you add
spaces, then try to remove them, it snaps the lines around kinda querky, i
don't think my users would have a clue how to control it.
 
J

James

thats a lot more work to use sql for every thing, is that nessisary?

textbox: after update()
form : on change()
form : onload()

where else would i need to put sql if i deside to go that route?
 
K

Ken Snell

Then you may need to use a completely different approach...one that isn't
reliant on the controls and performance of ACCESS directly. As you've
already seen, SQL can be used to write to the fields with the trailing
spaces...but ACCESS still will display the values without the trailing
spaces in controls.
 
T

TC

That is still Access discarding them from the datasheet >control<. It is not
Jet discarding them from the table field. Jet is quite happy to store
trailing spaces in fields, eg. using DAO .Addnew or .Edit, or SQL INSERT or
UPDATE.

TC
 
T

Tim Ferguson

thats a lot more work to use sql for every thing, is that nessisary?

It depends. To be honest, although I did not follow everything you were
saying, I think I'd use a completely different approach anyway. I just
dont' believe in using a chisel to hammer nails: the text box was never
meant to be used for formatted text.

Have you thought of something like putting the text into html and using the
shtmldoc control?-- it's one of those things that should be theoretically
possible although I haven't tried it.
where else would i need to put sql if i deside to go that route?

I really wouldn't... If I had to I'd probably do a separate dialog to enter
the text and put it all in the cmdOK_Click event... but I don't know your
db design.

I was only trying to explain where the problem lies with controlling white
space in text boxes.

All the best


Tim F
 
D

david epsom dot com dot au

The poster better not be planning to move to SQL Server without some
extra thought.....

(david)
 
T

TC

I understand that. I only butted in to suggest that it is better to say:
"Access discards trailing spaces from controls", rather than: "Access
discards trailing spaces from fields" :)

Cheers,
TC
 

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