Carriage return in text box.

  • Thread starter gsnidow via AccessMonster.com
  • Start date
G

gsnidow via AccessMonster.com

Greetings all. I have a form with the record source being a view from SQL
Server. There is a notes field with notes separated by a carriage return.
The access form field only displays the little square box between the notes
representing the carriage return. However, if I open the SQL Server view in
Excel, and format the column as wrap text, the notes do indeed display in the
desired format, which is to have one note per line in the field. Is there a
way to get an Access 2003 text box to display the carriage returns? In the
text, the notes are displayed like this, and let the brackets represent the
carriage return character...02/24/2010: Test note 3[]02/24/2010: Test note2[]
02/24/2010: Test note. However, if I copy the text box and paste it here, it
is property displayed as below...

02/24/2010: Test note 3.
02/24/2010: Test note 2.
02/24/2010: Test note

Any ideas? Thank you.

Greg
 
F

fredg

Greetings all. I have a form with the record source being a view from SQL
Server. There is a notes field with notes separated by a carriage return.
The access form field only displays the little square box between the notes
representing the carriage return. However, if I open the SQL Server view in
Excel, and format the column as wrap text, the notes do indeed display in the
desired format, which is to have one note per line in the field. Is there a
way to get an Access 2003 text box to display the carriage returns? In the
text, the notes are displayed like this, and let the brackets represent the
carriage return character...02/24/2010: Test note 3[]02/24/2010: Test note2[]
02/24/2010: Test note. However, if I copy the text box and paste it here, it
is property displayed as below...

02/24/2010: Test note 3.
02/24/2010: Test note 2.
02/24/2010: Test note

Any ideas? Thank you.

Greg

Most likely the little square represents a line feed character, not a
carriage return character.
In Excel, the carriage return/new line is just chr(10) (the line feed
character).
In Access, the carriage return/new line is chr(13) & chr(10), (a
carriage return character and a line space character) in that order.

You can run an update query on that field to replace the chr(10) with
chr(13) & chr(10).

Update YourTable Set YourTable.[FieldName] =
Replace([FieldName],chr(10),chr(13) & chr(10))
 
G

gsnidow via AccessMonster.com

Thank you Fred for your help. I actually just altered the function in SQL
Server to add CHAR(10) + CHAR(13). I was quite dismayed when two little
squares started showing up. However, as per you post, I reversed the the
order(I did not realize it made a difference), and voila, they are displaying
correctly now. Thanks again.
Greetings all. I have a form with the record source being a view from SQL
Server. There is a notes field with notes separated by a carriage return.
[quoted text clipped - 15 lines]

Most likely the little square represents a line feed character, not a
carriage return character.
In Excel, the carriage return/new line is just chr(10) (the line feed
character).
In Access, the carriage return/new line is chr(13) & chr(10), (a
carriage return character and a line space character) in that order.

You can run an update query on that field to replace the chr(10) with
chr(13) & chr(10).

Update YourTable Set YourTable.[FieldName] =
Replace([FieldName],chr(10),chr(13) & chr(10))
 

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