Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Reports / Printing / October 2005

Tip: Looking for answers? Try searching our database.

Add or Remove Section Programatically

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dmeiser - 28 Oct 2005 19:32 GMT
Hello,

I have a series of reports that are all essentially the same except for
an extra grouping.  I figured that, if I set the Section to Not Visible
(Visible = False) then the grouping would also disappear.  Except that
I was wrong.

So, what I think I need to do is find a way to say something like
Section(#).Grouping = False, which I noticed is not a valid method, or
just to remove the section altogether for a while.

Any thoughts?

Thanks,
DAVE
Marshall Barton - 28 Oct 2005 20:10 GMT
>I have a series of reports that are all essentially the same except for
>an extra grouping.  I figured that, if I set the Section to Not Visible
[quoted text clipped - 4 lines]
>Section(#).Grouping = False, which I noticed is not a valid method, or
>just to remove the section altogether for a while.

If you want the report sorted by the grouping field, then
you need to use the report's Open event procedure to set the
corresponding GroupLevel's ControlSource to =""

You will still get a group header/footer for the "" group,
so you still need to make it invisible.

The code will be something like:

    If <some condition> Then
        Me.GroupLevel(NN).ControlSource = ""
        Me.Section(KK).Visible = False
    End If

Signature

Marsh
MVP [MS Access]

dmeiser - 31 Oct 2005 20:03 GMT
Access wouldn't let me set the ControlSource to "", but I was able to
work around that by just setting the ConstrolSource equal to the next
ControlSource.  Essentially, I have 3 control sources, and I just
doubled up the second when I don't want grouping by the first.
Marshall Barton - 31 Oct 2005 21:50 GMT
>Access wouldn't let me set the ControlSource to "", but I was able to
>work around that by just setting the ConstrolSource equal to the next
>ControlSource.  Essentially, I have 3 control sources, and I just
>doubled up the second when I don't want grouping by the first.

That will usually work (sometimes you might need to set it
to the previous group), but I mispoke before, it should be

    Me.GroupLevel(NN).ControlSource = "=1"

Signature

Marsh
MVP [MS Access]

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.