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 » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Carriage return in a text box in a textbox in report.



 
 
Thread Tools Display Modes
  #1  
Old August 17th, 2007, 01:47 AM posted to microsoft.public.access.reports
Misha
external usenet poster
 
Posts: 59
Default Carriage return in a text box in a textbox in report.

Hi! Who knows, why this code make a space but not carriage return?


Me.txtText = rs("companyName") & Chr(13) & Chr(10) & "text1"

When just change ADO RS to a simple text, carriage is working.
  #2  
Old August 17th, 2007, 01:59 AM posted to microsoft.public.access.reports
Misha
external usenet poster
 
Posts: 59
Default Carriage return in a text box in a textbox in report.

I found: the problem was in TextFormat Property - plain text, but I had RTF.

"Misha" wrote:

Hi! Who knows, why this code make a space but not carriage return?


Me.txtText = rs("companyName") & Chr(13) & Chr(10) & "text1"

When just change ADO RS to a simple text, carriage is working.

  #3  
Old August 17th, 2007, 02:01 AM posted to microsoft.public.access.reports
Misha
external usenet poster
 
Posts: 59
Default Carriage return in a text box in a textbox in report.

THe problem was in TextFormat Property. It should be plain text not RTF.

"Misha" wrote:

Hi! Who knows, why this code make a space but not carriage return?


Me.txtText = rs("companyName") & Chr(13) & Chr(10) & "text1"

When just change ADO RS to a simple text, carriage is working.

  #4  
Old August 17th, 2007, 04:07 PM posted to microsoft.public.access.reports
krissco
external usenet poster
 
Posts: 167
Default Carriage return in a text box in a textbox in report.

On Aug 16, 4:47 pm, Misha wrote:
Hi! Who knows, why this code make a space but not carriage return?

Me.txtText = rs("companyName") & Chr(13) & Chr(10) & "text1"

When just change ADO RS to a simple text, carriage is working.


Try:
Me.txtText = Cstr(Nz(rs("companyName"), "")) & Chr(13) & Chr(10) &
"text1"

-Kris

  #5  
Old August 18th, 2007, 04:42 AM posted to microsoft.public.access.reports
Misha
external usenet poster
 
Posts: 59
Default Carriage return in a text box in a textbox in report.

Thank you Kris, I solved the problem, see my early post.

"krissco" wrote:

On Aug 16, 4:47 pm, Misha wrote:
Hi! Who knows, why this code make a space but not carriage return?

Me.txtText = rs("companyName") & Chr(13) & Chr(10) & "text1"

When just change ADO RS to a simple text, carriage is working.


Try:
Me.txtText = Cstr(Nz(rs("companyName"), "")) & Chr(13) & Chr(10) &
"text1"

-Kris


 




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 09:12 AM.


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