Refering to Controls array of group header levels gives an error

  • Thread starter Savvoulidis Iordanis
  • Start date
S

Savvoulidis Iordanis

It seems I can't get any reference to any of the controls of a group header
section. The code hangs on i=0

Private Sub GroupHeader1_Format(Cancel As Integer, FormatCount As Integer)
Dim i As Integer

For i = 0 To Me.Section(acGroupLevel1Header).Controls.Count - 1
MsgBox Me.Section(acGroupLevel1Header).Controls(i).Name
Next
End Sub

Why? This works perfectly on any other section I had to deal with (detail,
page header, group footer...)

I need this in order to reposition the controls of the section, before the
report is displayed/printed

TIA
 
A

Allen Browne

There was a bug with Windows XP messing up the reference to section controls
in an Access 97 database.

The other alternative, might be to loop through all the controls in the
report, and see which Section they belong to:
For Each ctl in Me.Controls
If ctl.Section ...
 
S

Savvoulidis Iordanis

Thanks, it worked. I just wanted it to be the fastest it could.

Anyway, which are the latest updates someone should have for Access 2000, on
W2000?
 

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