Add a text box in the Group Header:
Name:txtGrpCount
Control Source: =Count(*)
Visible: No
Add a text box in the detail section:
Name: txtRunSum
Control Source: =1
Running Sum: Over Group
Visible: No
Add another text box in the detail section
Name: txtUnImportant
Control Source: =IIf([txtRunSum]=[txtGrpCount],"Is Last","Not Last")
Visible: of course
Duane Hookom
MS Access MVP
To: MS_Access_Professionals@yahoogroups.com
From: kaluuma@yahoo.com
Date: Thu, 22 Sep 2011 16:45:29 +0000
Subject: [MS_AccessPros] Last Record of a Group in a Report
Hi,
I have a report Grouped on CodeName and Sorted on CodeName with 'A on top'.
Is it possible to find the last record in a group on a report. I am thinking of a Yes/No this is the last record in this group. If so, can one then use an event such as 'on print' to set a variable.
For example:
Private Sub PageFooterSection_Print(Cancel As Integer, PrintCount As Integer)
If Me.txtNum = Me.txtCount And Me.txtGrCount = 1 Then
Me.txtbox = ""
Else
If (this is the last record in the group) Then .... I do not know what the IF argument would be for Last Record in a Group thus the parenthesis.
me.txtbox = "Last Record"
end if
Me.txtbox= "Not the last record"
End If
End Sub
Thanks for any help.
Tom.
[Non-text portions of this message have been removed]
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/MS_Access_Professionals/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/MS_Access_Professionals/join
(Yahoo! ID required)
<*> To change settings via email:
MS_Access_Professionals-digest@yahoogroups.com
MS_Access_Professionals-fullfeatured@yahoogroups.com
<*> To unsubscribe from this group, send an email to:
MS_Access_Professionals-unsubscribe@yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
Tidak ada komentar:
Posting Komentar