Group Name in Group Header

  • Thread starter cdesio via AccessMonster.com
  • Start date
C

cdesio via AccessMonster.com

Now that I am able to group my report data using a form I need to figure out
how to put the name of what I am grouping by in the group header.

Can someone point me in the right direction?
 
L

Larry Linson

cdesio via AccessMonster.com said:
Now that I am able to group my report data using
a form I need to figure out how to put the name of
what I am grouping by in the group header.
Can someone point me in the right direction?

That Field, of course, has to be in the Record Source. In design view, you
can either place a Text Box in the Group Header and select the Field, or you
can display the Field List and drag and drop it into the Group Header.
(Same way you get any Field into any Section...)

Larry Linson
Microsoft Office Access MVP
 
M

Marshall Barton

cdesio said:
Now that I am able to group my report data using a form I need to figure out
how to put the name of what I am grouping by in the group header.

Can someone point me in the right direction?


OTOH, if you want to display the name of the grouping field,
then use a text box with the expression:

=forms!filters!filter_name
 
C

cdesio via AccessMonster.com

The problem is I am using GroupLevel so the Grouping changes. I need to find
a way to put what the group is in the groupheader.
 
A

Al Campagna

cdesio,
You wrote...
The problem is I am using GroupLevel so the Grouping changes.<
That doesn't make any sense. A Group is Group, and does not "change"
over a report.
Can you give us a small sample from your report that demonstrates your
problem?

Given this sample of grouping by Country, State, City...
CS is the ControlSource of a bound text control on the report.
------------------
Country Header CS = [Country]
------------------
State Header CS = [State]
---------------
Detail Section CS = [City]
--------------
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
C

cdesio via AccessMonster.com

Al,

Depending on what the form says I may group by City or I may group by State.

On the group header if I am grouping by City I would like it to say
Minneapolis, Chicago etc instead of just "City", if on the other hand I am
grouping by State then I want it to say Minnesota, Illinois etc instead of
just "State".

Hope that clears it up.

Al said:
cdesio,
You wrote...
The problem is I am using GroupLevel so the Grouping changes.<
That doesn't make any sense. A Group is Group, and does not "change"
over a report.
Can you give us a small sample from your report that demonstrates your
problem?

Given this sample of grouping by Country, State, City...
CS is the ControlSource of a bound text control on the report.
------------------
Country Header CS = [Country]
------------------
State Header CS = [State]
---------------
Detail Section CS = [City]
--------------
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
The problem is I am using GroupLevel so the Grouping changes. I need to
find
[quoted text clipped - 15 lines]
 
C

cdesio via AccessMonster.com

This is the code I am using to choose what to group by.

Private Sub Report_Load()

If IsNull(Forms.Reports.GroupBy) = False Then
Me.GroupLevel(0).ControlSource = Forms.Reports.GroupBy

End If

If IsNull(Forms.Reports.GroupBy) = True Then
Me.GroupFooter0.Visible = False
End If

End Sub




Al said:
cdesio,
You wrote...
The problem is I am using GroupLevel so the Grouping changes.<
That doesn't make any sense. A Group is Group, and does not "change"
over a report.
Can you give us a small sample from your report that demonstrates your
problem?

Given this sample of grouping by Country, State, City...
CS is the ControlSource of a bound text control on the report.
------------------
Country Header CS = [Country]
------------------
State Header CS = [State]
---------------
Detail Section CS = [City]
--------------
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
The problem is I am using GroupLevel so the Grouping changes. I need to
find
[quoted text clipped - 15 lines]
 
M

Marshall Barton

cdesio said:
This is the code I am using to choose what to group by.

Private Sub Report_Load()

If IsNull(Forms.Reports.GroupBy) = False Then
Me.GroupLevel(0).ControlSource = Forms.Reports.GroupBy

End If

If IsNull(Forms.Reports.GroupBy) = True Then
Me.GroupFooter0.Visible = False
End If

End Sub


Your code should be more like:

Private Sub Report_OPEN(...

If Not IsNull(Forms.Reports.GroupBy) Then
Me.GroupLevel(0).ControlSource = Forms.Reports.GroupBy
Me.[header text box].ControlSource = Forms.Reports.GroupBy
Me.GroupFooter0.Visible = False
End If

End Sub
 

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