Page Break

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a report for which I need to force a page break for 2 conditions, one
is when the member ID changes (I am able to set up a grouping for this and it
works fine). However, when the number of detail lines for a member exceeds
8, I need to print the remainder of the form which are lines to form a grid
and force a new page to print the remaining information for that member on
the subsequent page. I tried setting the bottom part of the form in the page
footer. However, causes the bottom of the form to be bottom floating and
causes a break in the grid. I noticed in the sorting and grouping box, you
can enter an expression, is there anything I can enter there?

There is an example in the northwind DB that someone forwarded to me the
other night which comes close, but does not resolve the problem. The
difference is that the orderid in the example is different for each order. I
don't want to break unless the member ID changes or number of detail records
are greater than 8.
 
You could go back to your original thread/response and probably change the
SQL of the query to start renumbering for each different MemberID. Is that
what you would need?
 
Thanks Duane. I believe that would work, any ideas on where I could find
some code examples of how to do that?
 
Consider this sql which sorts by customerID and groups a single customers
orders into groups of 8. The first 8 orders from a customer are assigned a
[Group8] value of 0. The next up to 8 orders are assigned a [Group8] value
of 1. The next customer starts numbering a 0.

SELECT Orders.CustomerID, Orders.OrderID, Orders.OrderDate,
(Count(Orders_1!OrderID)-1)\8 AS Group8
FROM Orders, Orders AS Orders_1
WHERE (((Orders_1.OrderID)<=[Orders]![OrderID]) AND
((Orders.CustomerID)=[Orders_1]![CustomerID]))
GROUP BY Orders.CustomerID, Orders.OrderID, Orders.OrderDate
ORDER BY Orders.CustomerID, Orders.OrderID;
 
Thanks Duane! It worked!

Duane Hookom said:
Consider this sql which sorts by customerID and groups a single customers
orders into groups of 8. The first 8 orders from a customer are assigned a
[Group8] value of 0. The next up to 8 orders are assigned a [Group8] value
of 1. The next customer starts numbering a 0.

SELECT Orders.CustomerID, Orders.OrderID, Orders.OrderDate,
(Count(Orders_1!OrderID)-1)\8 AS Group8
FROM Orders, Orders AS Orders_1
WHERE (((Orders_1.OrderID)<=[Orders]![OrderID]) AND
((Orders.CustomerID)=[Orders_1]![CustomerID]))
GROUP BY Orders.CustomerID, Orders.OrderID, Orders.OrderDate
ORDER BY Orders.CustomerID, Orders.OrderID;


--
Duane Hookom
MS Access MVP
--

Larry Abell said:
Thanks Duane. I believe that would work, any ideas on where I could find
some code examples of how to do that?
 
Back
Top