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 / Forms / October 2005

Tip: Looking for answers? Try searching our database.

Dynamic Sort order

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Paul Hammond - 18 Oct 2005 16:10 GMT
I am trying to make one report serve multiple functions.   I had to add an
additional grouping level to satisfy a request from one end user.   I hide
this grouping based on a value in a combo box.   This works except it keeps
sorting by this group level, even though it is not visible.   This sorting
will not work for the other end user.

How can I make the report ignore the sorting when the group is not visible?

Paul Hammond
Richmond, VA
Allen Browne - 18 Oct 2005 17:51 GMT
Is this the only GroupLevel in the Sortin'n'Grouping dialog?

If so, the report has to sort by something. Perhaps the primary key would be
a good candidate if nothing else is obvious.

If not, you can set the unused lower GroupLevel to the same field as your
primary GroupLevel. That should cause it to sort only on the one field.

Sounds like you have already figured out how to set the ControlSource of the
GroupLevel at runtime.

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

>I am trying to make one report serve multiple functions.   I had to add an
> additional grouping level to satisfy a request from one end user.   I hide
[quoted text clipped - 8 lines]
> Paul Hammond
> Richmond, VA
Paul Hammond - 18 Oct 2005 22:22 GMT
> Sounds like you have already figured out how to set the ControlSource of the
> GroupLevel at runtime.

Actually that hadn't occured to me, but it worked like magic the first time.
You can't see the big smile on my face!

Thanks loads,

Paul

> Is this the only GroupLevel in the Sortin'n'Grouping dialog?
>
[quoted text clipped - 19 lines]
> > Paul Hammond
> > Richmond, VA
Paul Hammond - 25 Oct 2005 20:26 GMT
Problem:
I have started getting an error while doing this.

"You can't set the Control Source property in print preview or after
printing has started."

Here's my code:
Private Sub Report_Open(Cancel As Integer)
   If Form_frmMain.cboSource = 1 Then
       Me.GroupHeader4.Visible = False
       Me.GroupFooter1.Visible = False
       Me.GroupLevel(2).ControlSource = "[ProdCode]"
   End If
end sub

It's very confusing, because I tested this successfully previously.

Paul
Signature


Paul

> Is this the only GroupLevel in the Sortin'n'Grouping dialog?
>
[quoted text clipped - 19 lines]
> > Paul Hammond
> > Richmond, VA
Allen Browne - 26 Oct 2005 03:46 GMT
Not sure what's happening there, Paul.

My page explaining the general procedure is:
   http://allenbrowne.com/ser-33.html

Presumably you already have 3 levels defined in the Sorting and Grouping
dialog? (It's zero-based, so GroupLevel(2) is the 3rd one.)

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

> Problem:
> I have started getting an error while doing this.
[quoted text clipped - 43 lines]
>> > Paul Hammond
>> > Richmond, VA
Paul Hammond - 26 Oct 2005 14:11 GMT
I've discovered what the problem is.

The report I was trying to set the Control Source of was a subreport.    The
error did not occur when I ran the report solo.

Paul
Signature


> Not sure what's happening there, Paul.
>
[quoted text clipped - 51 lines]
> >> > Paul Hammond
> >> > Richmond, VA
 
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.