A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Carriage return in text box.



 
 
Thread Tools Display Modes
  #1  
Old February 24th, 2010, 04:39 PM posted to microsoft.public.access.forms
gsnidow via AccessMonster.com
external usenet poster
 
Posts: 10
Default Carriage return in text box.

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

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/201002/1

  #2  
Old February 24th, 2010, 05:01 PM posted to microsoft.public.access.forms
fredg
external usenet poster
 
Posts: 4,386
Default Carriage return in text box.

On Wed, 24 Feb 2010 16:39:25 GMT, gsnidow via AccessMonster.com wrote:

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))


--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
  #3  
Old February 24th, 2010, 05:46 PM posted to microsoft.public.access.forms
gsnidow via AccessMonster.com
external usenet poster
 
Posts: 10
Default Carriage return in text box.

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.

fredg wrote:
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]

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))


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/201002/1

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:35 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.