help with formatting in the report

S

subs

group Total1 Total2
A 20 30
A 40 50
A 60 79
B 78 777
B 65 25
B 84 95


Output required is
group Total1 Total2
20 30
A 40 50
60 79

78 777
B 65 25
84 95

Can somebody help me how to create the report in the above format.
Please note the change is in first colmn only. Three A s are replaced
by one A in the middle. Same with B. How to create that in the design
view or on wizard. Can i create a grouping for first column but how
would i bring A and B at the center of other fields?

thanks
 
M

Marshall Barton

subs said:
group Total1 Total2
A 20 30
A 40 50
A 60 79
B 78 777
B 65 25
B 84 95


Output required is
group Total1 Total2
20 30
A 40 50
60 79

78 777
B 65 25
84 95

Can somebody help me how to create the report in the above format.
Please note the change is in first colmn only. Three A s are replaced
by one A in the middle. Same with B. How to create that in the design
view or on wizard. Can i create a grouping for first column but how
would i bring A and B at the center of other fields?


Most people put that kind of thing on the first record, but
you want what you want.

It gets a little tricky but I think this should come close
to doing that:

Using Sorting and Grouping (View menu), create a group on
the group field (if that's not a good reason why you should
not use a reserved word as a field name, I never saw one.)

Add a text box (named txtGrpCnt) to the group header section
and set it's control source expression to =Cpunt(*)
This will tell you how many records are in the group.

Next add a text box (named txtLine) to the detail section.
Set its expression to =1 and its RunningSum property to Over
Group. This allow you to know which record is being
processed.

Then add a line of code to the detai section's Format event
procedure:
Me.[your group text box].Visible = (txtLine=(txtGrpCnt+1)\2)
 
D

Duane Hookom

Of course Marsh meant:
set it's control source expression to =Count(*)
--
Duane Hookom
Microsoft Access MVP


Marshall Barton said:
subs said:
group Total1 Total2
A 20 30
A 40 50
A 60 79
B 78 777
B 65 25
B 84 95


Output required is
group Total1 Total2
20 30
A 40 50
60 79

78 777
B 65 25
84 95

Can somebody help me how to create the report in the above format.
Please note the change is in first colmn only. Three A s are replaced
by one A in the middle. Same with B. How to create that in the design
view or on wizard. Can i create a grouping for first column but how
would i bring A and B at the center of other fields?


Most people put that kind of thing on the first record, but
you want what you want.

It gets a little tricky but I think this should come close
to doing that:

Using Sorting and Grouping (View menu), create a group on
the group field (if that's not a good reason why you should
not use a reserved word as a field name, I never saw one.)

Add a text box (named txtGrpCnt) to the group header section
and set it's control source expression to =Cpunt(*)
This will tell you how many records are in the group.

Next add a text box (named txtLine) to the detail section.
Set its expression to =1 and its RunningSum property to Over
Group. This allow you to know which record is being
processed.

Then add a line of code to the detai section's Format event
procedure:
Me.[your group text box].Visible = (txtLine=(txtGrpCnt+1)\2)
 
M

Marshall Barton

Duane said:
Of course Marsh meant:
set it's control source expression to =Count(*)


Yes, I did. But the p key is right next to the o key so at
least it was close ;-)
 

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