Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Reports / Printing / October 2005

Tip: Looking for answers? Try searching our database.

Accessing Detail Data from Group Header

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David Horowitz - 07 Oct 2005 22:44 GMT
Hi folks.

I need to create a report that has a Group Header that pulls certain data
from the Detail section. It's something like this:

+--Report----------------------------------------

+--Group Header----------------------------------

| Codes: XYZ, XXX, YYY

+--Detail----------------------------------------
|          When     IsIt     Code
|          -------  -----    ----
| Row      10/1/05    Y      XYZ
| Row      10/2/05    N      XXX
| Row      10/1/05    N      YYY
+---------------------------------------------

And the RecordSource is something simple like this:
Report.RecordSource="SELECT When, IsIt, Code FROM TheTable"

So I just need this TextBox in the Group Header that's a string
concatenation of the values of the Code column from the records that are in
the Detail section of THIS PAGE. There may be more than one page for each
group.

Hope this makes sense so far. What I don't know how to do is the Codes list
part in the Group Header. Obviously I'm going to concatenate the strings
from the detail records, but how can I pick up the data from the Detail
records? What Event Procedure would I hook into, and how would I actually
reference the data needed?

I guess I can either try to read the detail data from the form, but I think
the Group Header events only have access to the first Detail record, and the
Group Footers only have access to the last. There's no way to get access to
all of them, is there?

What if I concat the strings together in the Detail_Print event, and then
stick that value into a textbox in the GroupHeader? I tried that, but it
seems the group header is already finalized by the time the detail records
are printed, so how could I force the Group Header to redraw AFTER I concat
the values?

And I wouldn't mind opening a Connection to the DB and running my own SQL
query to get the data I want, but how would I know which records were going
to be on this page? I guess in the Group Header, if, as according to the
docs, I can get the first Detail record data from the textboxes, I guess I
could run a query knowing now which is the first record on the page, and
then I could select records appropriately to concat.

Thanks in advance!

David
PC Datasheet - 08 Oct 2005 01:01 GMT
See my response in the other newsgroup you posted to.

You need to read the FAQ. Posting this way to multiple newsgroups is frowned
upon.

Signature

                                       PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
                             resource@pcdatasheet.com
                                www.pcdatasheet.com

> Hi folks.
>
[quoted text clipped - 57 lines]
>
> David
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.