INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Report - Turn Grouping On And Off?

Report - Turn Grouping On And Off?

(OP)
I have a report that has 2 groupings and 2 sortings. I want to use a form to dictate whether the top grouping (GroupHeader(0)) is on or not. I have it partially working, where it doesn't show the group or it's 1 textbox control. But the 2nd grouping still seems to group it's data by the first grouping that isn't showing. Can someone please help me understand what I am doing wrong?


This is my onopen of the report - I pass the openargs with a 1 or 0 based on a form checkbox.

CODE

If Me.OpenArgs = 1 Then
    Me.GroupLevel(0).ControlSource = "Field4"
    Me.GroupLevel(0).SortOrder = True
    Me.Section(5).Visible = True
    Me.txtGroupException.Visible = True
    Me.txtGroupException.ControlSource = IIf(Len([Field1]) > 0, [Field1] & ": ", "") & IIf(Len([Field2]) > 0, [Field2] & " - ", "") & IIf(Len([Field3]) > 0, [Field3], "") & " - (" & [Field4] & ")"
Else
    Me.Section(5).Visible = False
    Me.GroupHeader0.Visible = False
    Me.txtGroupException.Visible = False
    Me.txtGroupException.ControlSource = ""
End If 

Thanks!

misscrf

It is never too late to become what you could have been ~ George Eliot

RE: Report - Turn Grouping On And Off?

If you truly want to ignore a grouping/sorting, you set its Control Source property to a constant like =1.

Duane
Hook'D on Access
MS Access MVP

RE: Report - Turn Grouping On And Off?

(OP)
ahhhh. Does this make sense, though? That you would have a report menu for criteria to pass to a report, including having the report grouped or not?

I will try this and see how it goes.

misscrf

It is never too late to become what you could have been ~ George Eliot

RE: Report - Turn Grouping On And Off?

Are you asking me/us if something you want to accomplish makes sense? If so, it depends on your business requirements.

Duane
Hook'D on Access
MS Access MVP

RE: Report - Turn Grouping On And Off?

(OP)
I guess lol. NM. Now I'm debugging the criteria and getting a weird error. I'll post it in another thread.

misscrf

It is never too late to become what you could have been ~ George Eliot

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close