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!

Keep printing to groups of five

Status
Not open for further replies.

RonMcIntire

Technical User
Oct 12, 2002
166
US
All:

PROJECT
I'm developing a weekly member sign-in sheet for an organization.

The names are in a subreport and are printed in groups of five names separated by a blank line.

PROBLEM
I don't know how to break off printing when the last group on the report page is fewer than five names.

Can anyone help?

Ron
 
The first idea that is coming to me is to group on a sequence number integer divided by 5.

Imagine you have data like below...

Seq OtherMemberData
1 MemberA
2 MemberB
3 MemberC
4 MemberD
5 MemberE
6 MemberF
7 MemberG


You could add a field to your query that looks like

FiveTogether: SEQ \ 5

Then in your report group by FiveTogether and in the report footer put your space.

Note the expression uses integer division (backslash) and not division (forward slash).

The problem with this method is that it assumes you have a sequence field. It is also the easier method.

Moving on, you could also have a subreport that is the space you want. You would set it's can shrink property to yes. Then you would programmatically set its visible proerty to true or false in the on format event for the section. I would use similar logic there except I would add a field that contained had a literal 1. Set the running sum property of a text box (txtCounter) which has this field as the control source.

If Me!txtCounter Mod 5 = 0 Then
Me!SubformControl.Visible = True
Else
Me!SubformControl.Visible = False
End if

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top