RepeatSection Property at runtime

T

terri

I am using 2000RT.

Access help says the RepeatSection property may be set via code, however, I
have not been able to find ANY event that allows it to be changed. Can it
only be accessed in design?
 
M

Marshall Barton

terri said:
I am using 2000RT.

Access help says the RepeatSection property may be set via code, however, I
have not been able to find ANY event that allows it to be changed. Can it
only be accessed in design?


I think using VBA in the report itself to manipulat
RepeatSection either only operates on the next group or can
only be done in the report's Open event. In any event, it's
not a solution to whatever problem you're trying to solve.

Prior to A2003, there were many situations where doing
things (Cancel, Visible, ??) to a repeated section caused
the report to hang. I have learned the hard way to use this
property only in a simple straightforward way. In A2003,
they "fixed" the hang problem by simply turning the property
off whenever you tried to do anything fancy with it.

Be careful when you see a help topic that says something can
be set using VBA code. There are some things where that is
true, but only in a design time wizard type procedure.
 
T

terri

Thanks for the reply Marshall.

Well I thought what I'm trying to do is quite straightforward...

Having the section repeat is a user option that can be set on the form that
opens the report. I only need to set the RepeatSection option ONCE, when the
report is first opened. However, the Open Event says "You can't assign a
value to this object." The same holds true for any other event I tried.
 
M

Marshall Barton

terri said:
Thanks for the reply Marshall.

Well I thought what I'm trying to do is quite straightforward...

Having the section repeat is a user option that can be set on the form that
opens the report. I only need to set the RepeatSection option ONCE, when the
report is first opened. However, the Open Event says "You can't assign a
value to this object." The same holds true for any other event I tried.

You're right. It appears that RepeatSection can only be set
at design time.

OTOH, if you (and all of your users) are using A2003, you
can take advantage of the heavy handed "fix" to the hang
problem. For example this will effectively turn it off:

Private Sub GroupFooter1_Format(Cancel As Integer,
FormatCount As Integer)
Me.GroupHeader0.Visible = True
End Sub

Private Sub PageHeaderSection_Format(Cancel As Integer,
FormatCount As Integer)
Me.GroupHeader0.Visible = (Me.Page = 1)
End Sub

If I remember correctly, that code causes a A2002 report to
hang and what it will do in versions after A2003 is
anybody's guess, but, IMO, the odds are fair to good that it
will still do what you want.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top