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

Grouping/Keep Together Problem

Status
Not open for further replies.

Robbo1974

Technical User
Jun 1, 2001
151
GB
Hi all,

I have a set of reports which show Order information based on various criteria. The report is sectioned as below:

rptHeader - Report title & Company logo

OrderNumberHeader - Order number, date of order, person that placed the order, company that placed the order & order type.

Detail - Details of products ordered, grouped by item(quantity, unit price, item value, product & description)

eg

Product: Product1 (Description). Units Ordered: 2
Unit Price Charged: £100.00. Item Value: £200
--------------------------------------------------
Product: Product2 (Description). Units Ordered: 4
Unit Price Charged: £125.00. Item Value: £500


OrderNumberFooter - Total Order Value (Sum([Item Value]))

rptFooter - usual date & time stuff

Nice and simple eh? ;-)

Each order has it's own unique order number and can consist of any number of products.The problem comes with grouping the information for each instance of OrderNumber. What I want to do (for the sake of clarity more than anything) is force a new page after the OrderNumberFooter but only if there is not enough room to display all three sections which make up the order together. Should be a simple case of using the sorting and grouping properties but I can't get it to do anything other than print each seperate order on a seperate sheet of the report - not much good when you're trying to print 150 orders! I have also tried various combinations of yes/no on the individual section's keep together property but to no avail.

I know that this is bound to be something dead simple that I have overlooked! Does anyone have any ideas cos this is driving me nuts! X-( Robbo ;-)
 
No joy there Tyrone, have tried already - sorry, should have mentioned it. It seems that no matter what combination I use, the report splits to one order per page if I change any of the Force New Page or Group Keep Together properties to any of the values. very frustrating. Robbo ;-)
 
Robbo,

I think I've done something similar to this. Add a new header after OrderNumberHeader and move the fields that are currently in your detail section into it, setting GroupOn to EachValue. Set KeepTogether to WholeGroup. This section will act as your detail section, so you can eliminate the detail section, but will force a page break if this "detail" can't fit on the current page......
 
Sorry Cosmo, not working either. The problem is not forcing a new page when the controls in one section of the report wont display together on the page, but when the contents of all three sections will not fit into the remaining space.

Is there any way that I can 'group' the three sections so that access will treat them as just one when it comes to deciding when to start a new page? Robbo ;-)
 
OK, I have found a report that is just like this. Go back to your original design of header, detail, and footer. Set ForceNewPage to None for all three sections. Set KeepTogether to Yes for all three sections. This works for me; if the group doesn't fit it starts on the next page....
 
Sorry Cosmo, all heck is breaking loose around me at the minute! I don't do the db thing full time and I've just had a shedload of work dumped on me from a great height! The joys of being multi-skilled eh? Oh yes, and would you believe that I don't have web access at my desk? I have to come to a seperate building on site to do this (I know)!

Trying your suggestion has again produced exactly the same problem - the individual sections of the report do keep together, but the three sections will be printed across seperate pages if there is not enough room to keep them together. V frustrating.

I need to make access treat all three sections as one, hence my first thought - using the sorting and grouping properties. I am well flummoxed by this one - and reports are usually pretty simple too!

Woulkd an email copy help? My add is iain.robertson@leedsrugby.com Robbo ;-)
 
Problem solved:

After all this hassle, the solution was actually very simple - use the sorting and grouping properties (set the keep together property to 'whole group') whilst ensuring that for the individual sections, the keep together property was set to yes and the force new page property was set to no.

The only reason I got there though was with the stimulus of trying different approaches suggested by others. That is the real strength of this forum, I don't come here and just get solutions dropped into my lap, but have the opportunity to work through the problem and in doing so improve my own knowledge and (hopefully sometimes!) the knowledge of others. Membership of this forum has definitely helped me to become a better access developer. Robbo ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top