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  

line feed not showing in report



 
 
Thread Tools Display Modes
  #1  
Old January 4th, 2010, 10:00 PM posted to microsoft.public.access.reports
Keith G Hicks
external usenet poster
 
Posts: 130
Default line feed not showing in report

I have some code that is concatenating names together using vbCrLf. I also
tried Chr(13)&Chr(10) which are supposed to be the same anyway. I assign the
names to a string variable and then in the OnFormat of the report detail I
assign the values to the caption of a lable. Trouble is the line feeds don't
end up in there.

Public sEmpNames as String
sEmpNames = ""

loop through the names table...
While ....
if sEmpNames = "" Then
sEmpNames = next name in table
else
sEmpNames = sEmpNames & vbCrLf & next name in table
endif
...movenext
Wend

In the report I'm simply doing this:

Me.lblEmpNames.Caption = sEmpNames

Like I said, the names appear but all jammed together. I've tried converting
sEmpNames to a function and using it in the source for a text box as well.
Neither strategy works.

The same sEmpNames variable is being used in a bookmark in Word automation
and it comes out fine. What's happening to my line feeds in the Access
report?

Keith


  #2  
Old January 4th, 2010, 10:13 PM posted to microsoft.public.access.reports
Keith G Hicks
external usenet poster
 
Posts: 130
Default line feed not showing in report

I know the line feeds are there. When I put the variable in the Immediate
window, it runs the names out on separate lines.


"Keith G Hicks" wrote in message
...
I have some code that is concatenating names together using vbCrLf. I also
tried Chr(13)&Chr(10) which are supposed to be the same anyway. I assign
the names to a string variable and then in the OnFormat of the report
detail I assign the values to the caption of a lable. Trouble is the line
feeds don't end up in there.

Public sEmpNames as String
sEmpNames = ""

loop through the names table...
While ....
if sEmpNames = "" Then
sEmpNames = next name in table
else
sEmpNames = sEmpNames & vbCrLf & next name in table
endif
...movenext
Wend

In the report I'm simply doing this:

Me.lblEmpNames.Caption = sEmpNames

Like I said, the names appear but all jammed together. I've tried
converting sEmpNames to a function and using it in the source for a text
box as well. Neither strategy works.

The same sEmpNames variable is being used in a bookmark in Word automation
and it comes out fine. What's happening to my line feeds in the Access
report?

Keith



  #3  
Old January 4th, 2010, 10:21 PM posted to microsoft.public.access.reports
Keith G Hicks
external usenet poster
 
Posts: 130
Default line feed not showing in report

Never mind. My code for the Word automation was just using vbCr. That wasn't
enough. I do a Replace in the Access report so that vbCr's become vbCrLf and
it's all good.


"Keith G Hicks" wrote in message
...
I have some code that is concatenating names together using vbCrLf. I also
tried Chr(13)&Chr(10) which are supposed to be the same anyway. I assign
the names to a string variable and then in the OnFormat of the report
detail I assign the values to the caption of a lable. Trouble is the line
feeds don't end up in there.

Public sEmpNames as String
sEmpNames = ""

loop through the names table...
While ....
if sEmpNames = "" Then
sEmpNames = next name in table
else
sEmpNames = sEmpNames & vbCrLf & next name in table
endif
...movenext
Wend

In the report I'm simply doing this:

Me.lblEmpNames.Caption = sEmpNames

Like I said, the names appear but all jammed together. I've tried
converting sEmpNames to a function and using it in the source for a text
box as well. Neither strategy works.

The same sEmpNames variable is being used in a bookmark in Word automation
and it comes out fine. What's happening to my line feeds in the Access
report?

Keith



  #4  
Old January 6th, 2010, 01:06 AM posted to microsoft.public.access.reports
Armen Stein[_2_]
external usenet poster
 
Posts: 157
Default line feed not showing in report

On Mon, 4 Jan 2010 17:21:31 -0500, "Keith G Hicks"
wrote:

Never mind. My code for the Word automation was just using vbCr. That wasn't
enough. I do a Replace in the Access report so that vbCr's become vbCrLf and
it's all good.


Thanks for letting us know. That would have been a tough one for us
to spot without seeing all the actual automation code.

Armen Stein
Microsoft Access MVP
www.JStreetTech.com

  #5  
Old January 6th, 2010, 01:46 AM posted to microsoft.public.access.reports
Keith G Hicks
external usenet poster
 
Posts: 130
Default line feed not showing in report

Yeah, it was pretty much making me nuts until I noticed that my automation
code used vbCr only. Then I rememberd that when I first set that code up,
vbCrLf didn't work as I expected so I just used vbCr. The thing that puzzled
me was that with just vbCr the breaks were there in the Access vba immediate
pane but not in the report controls preview.


"Armen Stein" wrote in message
...
On Mon, 4 Jan 2010 17:21:31 -0500, "Keith G Hicks"
wrote:

Never mind. My code for the Word automation was just using vbCr. That
wasn't
enough. I do a Replace in the Access report so that vbCr's become vbCrLf
and
it's all good.


Thanks for letting us know. That would have been a tough one for us
to spot without seeing all the actual automation code.

Armen Stein
Microsoft Access MVP
www.JStreetTech.com



 




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 12:39 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.