Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

want to keep spaces at end of text in record 1

Status
Not open for further replies.

imarosel

Technical User
Jun 23, 2005
149
US
I want to be able to store spaces at the end of text in the records of my database. Everytime I enter spaces at the end of a string the get truncated when I leave the record. I'm using these combining these records to make strings and I need the spaces customizable at this level. Idon'twantmytextstringstolooklikethis.
 
I think Access automatically RTrims any data when it goes into a text field in a table. There may be a way around this, but I don't know it. The workaround is to add the spaces when you create the string, using the .Size value of the text field (assuming you want it padded out to the total field size).

I'm not sure if access has an RPad function, but you could do that or just concat Space(n) where n is the total size minus the current (trimmed) length.
--Jim
 
I'm making this for other users so I was trying to keep the monkeying to a minimum. Easist thing for user when they want a space is add a space. I guess I'll just code it in and make lots of adjustments. Thanks anyways.
 
Microsoft confirms that you can't enter trailing spaces. If you are uning a fixed number of spaces at the end of the data in question like 1 they recommend creating a query to add the space and then using the query instead of the table.

FieldName & Space(x) is the function they use where x=number of spaces added.



Hope this helps.

OnTheFly
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top