[AccessD] Brain Fart on Report grouping
Jim Dettman
jimdettman at verizon.net
Wed Jan 24 13:37:45 CST 2018
Maybe you're thinking of just knowing when you're on the last page, which is
when you can do:
If Me.Page = Me.Pages then
But for last group, you need to know what the last group is.
You can do what you did, walk through the recordset that the report is based
on, or enable two pass printing and capture the last group on the first
pass.
For what you needed, what you did is the most efficient. Might possibly
break in the future more easily if something is changed, but it is the most
efficient method that I can think of.
Jim.
-----Original Message-----
From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of
Ryan W
Sent: Wednesday, January 24, 2018 12:47 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Brain Fart on Report grouping
Huh. Alright. I could have sworn there were some VBA properties in the
OnPrint event to help tell where you were but it's been a while since I've
had to write any VBA for report formatting on the fly.
On Wed, Jan 24, 2018 at 11:28 AM, Jim Dettman <jimdettman at verizon.net>
wrote:
> Well you need some type of flag to tell you when you are on the last
> client.
>
> There are several ways to do that, and believe it or not, what your
> doing is probably the cleanest.
>
> Jim.
>
> -----Original Message-----
> From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf
> Of Ryan W
> Sent: Wednesday, January 24, 2018 10:54 AM
> To: Access Developers discussion and problem solving
> Subject: [AccessD] Brain Fart on Report grouping
>
> I have a report that's grouped by Client name, each grouping has a
> footer that draws a line (thickness 1) to help break the report up
> between clients.
>
> At the end of the report, I have a REPORT footer that draws a line
> (thickness 2) with some statistics under it.
>
>
> Right now, when the last group footer prints a line, and the report
> footer prints it's line they're stacked on top of each other. I could
> have sworn there was some magic wizardry I've done in the past to not
> draw that last grouped footer line relatively easily. I have a
> solution that works NOW but it feels like kludge.
>
>
> Basically I have a global report variable defined at the top "strClient"
>
>
> In Report_Open event I set that variable using:
>
> strClient = DMax("ClientName", "Table")
>
> For GroupFooter1_Print event I have :
>
> Me.LineName.visible = not (Me.ClientName = strClientName)
>
> It works but as I said feels Kludgy.
>
> Thoughts?
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
More information about the AccessD
mailing list