Report page break question

pickle76

New member
Local time
Today, 05:23
Joined
Sep 10, 2002
Messages
5
Hey,
Here's what my report looks like:

Top of Page:
Size First Record
1.75
1.14
1.00
750
375
200
50
ALL
XXX Next record
XXX
1.75 Last record on page
1.14 Bottom of page
--------------------------- NEW PAGE STARTS--------------------------

Question: How do place a page break that makes the last incomplete record start on a new page. I.E. the last record on above example would start on new page because it didn't end completely with "ALL" like the first record.

I know I can't use the "sorting and grouping" then force page break because that would put new page after each size record.

Thanks much!
 
I would try to insert a page break at the bottom of the detail section and switch the visibility of this pagebreak on or off according to the condition you need in the On Format event of the detail section with something like this:

If [check your control on the report] = True then Me.[YourPageBreakName].Visible=True else Me.[YourPageBreakName].Visible=False

hth
SWK
 
thanks for reply.
are you giving me VB code? If so, I don't use that and was hoping you could elaborate on your solution.
I've inserted the page break and went to edit "On Format" event in details section. Now, which builder do I use...Expression, Macro, or code?
Thx
 
hi,

this was code - use the code builder exactly as you described. In Access you will need to use code very often if you need to do anything customised. This may be uncomfortable at the beginning but it makes Access very flexible and you will find countless bits of code around (e.g. the VBA forum here) so it is easy to get the hang of it.

Paste this line where the code builder takes you. Change the condition and the YourPageBreakName to suit your need. This line would be executed for each record displayed in the detail section so the page break will only be displayed if the condition is true. Of course this would only work if you have a single control to check and looking at your example I am not sure about that. If 50 and All in your example are different controlls then checking the controll that displays All should work for you.

E.g.
If Me.YourControllName<>"All" then Me.[YourPageBreakName].Visible=True else Me.[YourPageBreakName].Visible=False

hth
SWK
 
That coding does the same thing that "sorting and grouping" function does - it puts a page break after each record unless it starts with "ALL" and then it allows the next record to appear on the page "1.75", but then puts in another page break after |1.75" because it's not "ALL"

So is there any other way for this to work since all my sizes are under the same control?
 
Have you tried the 'keep together' property in the detail property list?
 

Users who are viewing this thread

Back
Top Bottom