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

VB Code help

Status
Not open for further replies.

btrini10

IS-IT--Management
Dec 5, 2006
73
US
Hi
Following is code I pulled off Microsoft's site to insert a continued on next page label if a field goes to the next page.
Public CurrentGroupVal as String

Function SetGlobalVar (InReport as Report)
CurrentGroupVal = InReport!SetGroupVal
End Function

Function SetContinuedLabel (InReport as Report)
If InReport.Page <> 1 then
InReport!ContinuedLabel.Visible = _
IIf(Trim(InReport!CheckGroupVal) = _
Trim(CurrentGroupVal), True, False)
End If
End Function

It works perfectly if I have only one field that goes to a next page. However, if I could have any one of a number of fields going over and want the message to show for any one of them, being not too familiar with VB, I am not sure how to modify the code. the instructions require a text box in the header and footer to be created with the field that may go over. In addition to including all the possible fields, I would also need to modify the code to consider any one of them.
Could anyone assist me in modifying the code?
The MS website where I found this code is:
Thanks in advance for any help.
 
btrini10
I'm not sure this will do precisely what you want...but if you have a Group Footer, you could put an unbound text box with the following structure in the Group Footer
Code:
=IIf([Page]>1,"continued from page " & [Page]-1,"")

Then you could figure out a way to count the pages in the group and reset the box each time the group changed.

Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top