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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text Is Cut Off in Report

Status
Not open for further replies.
Jun 2, 2004
66
US
I have designed a form that includes a large text box (in memo format) that can accept a large amount of info. Users often copy/paste large text files/email into it. The size limitation is not an issue on the form, because the user can use the scroll bar to get from top to bottom and read all of the text in the box.

However, I am running into problems with the report that I have made. Because there is such a great deal of info in the text box from the form, there does not seem to be a way to stretch the box enough in the report so that all of the text prints out. Is there a setting/way for that info to be printed even though the box in the report isn't big enough?

I'd appreciate any feedback.

Thanks

 
Yes, the textbox in your report has a property called Can Grow. Just set this property to Yes and the text box will expand downward as need to display and print all of the memo field data.

Good luck.

[COLOR=006633]Bob Scriver[/color]
MIState1.gif
[COLOR=white 006633]MSU Spartan[/color]
 
Thanks Bob. Works like a charm, but I don't want to let you off so easy.

Now when I print the report, it (obviously) prints multiple pages. Is there a way to have my label box (that appears above the text box) appear on each page? Now, that label box only appears on the first page of the report and disappears when the rest are printed.


Please let me know if you have any ideas.

Thanks
 
Well, you've got me on this one. I will have to think about it and see if I can conjur up something. Maybe someone else reading this can jump in here with a bright idea. I don't have any at this point.

[COLOR=006633]Bob Scriver[/color]
MIState1.gif
[COLOR=white 006633]MSU Spartan[/color]
 
Is it just a heading?

Try putting the label in the Page Header section.

-Gary
 
Glasop: This is the label for a textbox that may start anyplace on the page and carryover to the next page. The unpredictibility of where it starts and ends is the problem. I was thinking of a label in the Page Header that was set to visiblity = False. And only if the data rolled over to the next page would we set the visible property to True. Just haven't figured out how to determine that the second page contains data from the previous page.

[COLOR=006633]Bob Scriver[/color]
MIState1.gif
[COLOR=white 006633]MSU Spartan[/color]
 
Okay, let's try this. Create a label in the PageHeader appropriately placed so that it will appear just above the textbox of the detail section. Set it's visible property to False.

Create the following Form level variables:

Code:
Dim vBegPage as Long
Dim vID_Value as String

Now the variable vID_Value can be a string or number depending upon the ID for your records. I don't know what they are but adjust the Dim statement to whatever is necessary. We just want to be able to store the recordID in this variable when the Detail section begins printing. Then when the textbox grows to the nextpage we will be checking to see if the it is the same detail record. We will be setting the label to visible at that time.

Now in the Detail section OnFormat event procedure put the following:

Code:
vID_Value = Me![ID_controlname]
vBegPage = Me.Page

Now in the PageHeader OnFormat event Procedure put the following code:

Code:
If (Me![ID_controlname] = vID_Value) and (Me.Page <> vBegPage) then
   Me.labelname.visible = True
else
   Me.labelname.visible = false
End if

I think this should be close to what you want. Let me know after you have tested it out.

[COLOR=006633]Bob Scriver[/color]
MIState1.gif
[COLOR=white 006633]MSU Spartan[/color]
 
I attempted the above, but I am having problems plugging in the correct field names.

In the first set of code where you create the form level variables, where do you plug this into? In addition, how do I tailor it correctly with my ID name and report name?

My ID is called Call_Number
My Report is called Pending_Issues_Report
My Label is called Label61

So...from that, I tailored the first set of code and attached it to the OnOpen event procedure of the Form. I am pretty sure that this is incorrect, but I'm not sure where you would plug this in.

As for the other two sets of code, I know where to plug them in, but I'm not sure how to tailor the code according to my ID, Report name etc... What is BegPage? Do I put my report name in here?

Hopefully you could point me in the right direction.

Thanks
 
The 'FORM level variables' are actually "REPORT level variables". My typo. Copy and paste them into the General / Declarations area of the Reports Class module. To get there Open the report in design and click the Code button. Select General and Declarations from the two comboboxes and paste the code under the following lines:

Code:
Option Compare Database
Option Explicit

Now to update the code with your names:

Code:
vID_Value = Me![Call_Number]
vBegPage = Me.Page

Code:
If (Me![Call_Number] = vID_Value) and (Me.Page <> vBegPage) then
   Me.Label61.visible = True
else
   Me.Label61.visible = false
End if

Now there is no need to use the report name here. vBegPage is a variable which is updated everytime a new detail record is formatted. So if a detail records starts on the reports page 5 and the textcontrol with the memofield rolls over to the nextpage the code in the OnFormat event procedure of the Page Header section will check to see if where the record started is where the record is ending. What I mean here is if the Pageheader being printed is on Page 6 then and the record being printed is the same then the memo textbox control is being allowed to Grow and we need to display the label. If not then we are just starting a new page with a new detail record. Does this make sense?

Give this a try and let me know how it works.

[COLOR=006633]Bob Scriver[/color]
MIState1.gif
[COLOR=white 006633]MSU Spartan[/color]
 
See my code below... I am now getting an error that vID_Value is not defined.

Option Compare Database
Option Explicit

Dim vBegPage As Long
Dim vID_Value As String

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
vID_Value = Me![Call_Number]
vBegPage = Me.Page
End Sub


Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As Integer)
If (Me![Call_Number] = vID_Value) And (Me.Page <> vBegPage) Then
Me.Label61.Visible = True
Else
Me.Label61.Visible = False
End If
End Sub
 
Which line is it stopping on?? This shouldn't be happening as you have declared it as a report level declaration. Now you have declared it in the Report, yes???

[COLOR=006633]Bob Scriver[/color]
MIState1.gif
[COLOR=white 006633]MSU Spartan[/color]
 
OK. I got it to work. Spacing was wrong in my primary key name.

Now, the newly created box appears, but not at the correct time.
On any given day when I run my report, I might have 15 or so single pages (each call number fits on one page of the rpt.) Once in a while though, a call number might take up two pages. So, as you already know, I need the new label to only show up when the issue takes up two pages.

So...when I run my report now, the label appears on every page except for page 1. This is not right. In other words, if my report is 16 pages long (Pgs 1 through 14 are single page issues and Pgs 15 and 16 is 1 issue), the label should only appear on pg 16 since that page is the continuation of pg 15.

Thanks for your patience.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top