This is the code I'm trying to use
Private Sub Report_Open(cancel As Integer)
On Error GoTo roerr
...
If Forms![zform25]![Sortby1] = 1 Then
...
Me.GroupHeader1.RepeatSection = False
Me.GroupFooter1.Visible = False
...
End Sub
Repeatsection=false gives errors so i commented it out and if you keep it
true in the report and try visible=false it ends up getting stuck in
formatting page. There is no format event code in this report. I do change
grouplevel.controlsourse in the onopen event in the if above. I would like
to
get 1 of lines working if possible otherwise I will have to make a second
copy of the report for the option that needs repeatsection. Which would be
sad.
Thanks
Martin
Allen Browne said:
When are you setting this value? Set it once, in the Open event of the
Report, not every time (in the Format event of the section).
If that does not solve the problem, are there other sections that are
being
shown/hidden or that CanGrow/CanShrink? The interaction of these factors
can
cause Access to do a great deal of calculation to try to find the optimum
solution. Can you simplify this design?
If posssible avoid code in the Format event of the sections. For example,
it
is more efficient to use Conditional Formatting than to use code in the
Format event to achieve the same thing.
HTH