Solved finding the last record of each group (1 Viewer)

Jimal

Member
Local time
Today, 09:05
Joined
Sep 29, 2020
Messages
42
dear friends
im in a situation here.
I am furnishing the query result in a report and its grouped (say one group per page)
under every group of the report I need to highlight/indicate the last record...say with a remark / special note
can any one throw your thoughts to achieve the same..

regards
ji
 

jdraw

Super Moderator
Staff member
Local time
Yesterday, 22:35
Joined
Jan 23, 2006
Messages
13,402
How do you define "last" in your set up?
Also, reports have their own Sorting and Grouping.
 

Jimal

Member
Local time
Today, 09:05
Joined
Sep 29, 2020
Messages
42
Hi @jdraw
anything that comes as last value in that group (wtever the sorting by defautlt)
 

Jimal

Member
Local time
Today, 09:05
Joined
Sep 29, 2020
Messages
42
let me give a example
there are 20 children out of which 10 belongs to class A, 3 belongs to class B ,5 belonging to class C & rest belonging to class D
when I generate the report "group by" class , against any student name that comes as the last record of that Class group I want to add a remark ëg., "end of class A"
 

Gasman

Enthusiastic Amateur
Local time
Today, 03:35
Joined
Sep 21, 2011
Messages
7,172
Why can't you just use the group footer? :unsure:
 

Jimal

Member
Local time
Today, 09:05
Joined
Sep 29, 2020
Messages
42
dear @Gasman
thanks ,,but I want the remark against the last row of the record & not AFTER the record.... any thoughts??
 

Jimal

Member
Local time
Today, 09:05
Joined
Sep 29, 2020
Messages
42
@Gasman & @jdraw
This is the inpupt table

NameClassRemark
JohnA
CleaveB
ShawnC
JeanD
LillyA
samuelA
SheffD
tedB
gloryC
BenC
FriedoA
GwenB
MacC

and this is the format of the report grouped by CLASS ..
1603284477386.png

I want a remark against John - ": end of class A"
 

jdraw

Super Moderator
Staff member
Local time
Yesterday, 22:35
Joined
Jan 23, 2006
Messages
13,402
Look at strive4peace's suggestion in the link I provided in post #8 above.
 

jdraw

Super Moderator
Staff member
Local time
Yesterday, 22:35
Joined
Jan 23, 2006
Messages
13,402
Here is the link.
simthread.PNG

It is in the Similar Threads at the bottom of this page. Always a good place to seek related info.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 19:35
Joined
Oct 29, 2018
Messages
13,261
Hi. This should be possible in a report. You could probably use code or a running sum Textbox and a Count(*) per group.
 

jdraw

Super Moderator
Staff member
Local time
Yesterday, 22:35
Joined
Jan 23, 2006
Messages
13,402
Jimal,

Here is the info in the post that could be relevant to you.

hi @faty,

you can put a calculated field in the record source to figure this out:
IsLast: IIf([ItemNumber_fieldname]=nz(DMax("ItemNumber_fieldname","MyTable","GroupNumber_fieldname =" & [GroupNumber_fieldname]),1),True,False)

the advantage is that you can then just set up one conditional format using Expression Is:
[IsLast]=True
 

Jimal

Member
Local time
Today, 09:05
Joined
Sep 29, 2020
Messages
42
Hi @jdraw
I checked this already ,,but the logic has been done for numeric values... whereas my application is alphabets
 

Jimal

Member
Local time
Today, 09:05
Joined
Sep 29, 2020
Messages
42
Hi @theDBguy
infact I tried your idea roughly.
introducing running sum per record
introducing count(*) in footer
but how to make the relation between two I m not clear
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 19:35
Joined
Oct 29, 2018
Messages
13,261
Hi @theDBguy
infact I tried your idea roughly.
introducing running sum per record
introducing count(*) in footer
but how to make the relation between two I m not clear
Hi. Not sure if the Count() control has to be in the footer; but if it is, I hope it's the group footer.

You could try using something like:
Code:
=IIf([RunningCount]=[CountBox],"End of group " & [GroupName],"")
Hope that helps...
 

Users who are viewing this thread

Top Bottom