473,383 Members | 1,792 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Access Report Group Header Question

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
Nov 13 '05 #1
1 7299
Build a recordset from the recordsource of the report then create a public
subroutine (MySub) that loops through the recordset and builds the code
string you want in the Group Header. Put a textbox in the Group Header and
put the following expression in its control source:
=MySub().

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"David Horowitz" <da***@soundsidesoftware.com> wrote in message
news:lX*****************@fe09.lga...
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

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: edo | last post by:
Following is a summary of articles spanning a 7 day period, beginning at 12 Dec 2003 05:22:35 GMT and ending at 19 Dec 2003 04:09:06 GMT. Notes ===== - A line in the body of a post is...
11
by: James P. | last post by:
Hello, I have a report with the Priority field is used as sort order and grouping. The problem is the data in this Priority field if sorted in ascending order is: High, Low, and Medium. How...
7
by: dog | last post by:
I've seen plenty of articles on this topic but none of them have been able to solve my problem. I am working with an Access 97 database on an NT4.0 machine, which has many Access reports. I...
11
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on...
2
by: Tom | last post by:
This is related to an earlier post entitled "Text in Query/Numbers in Report" Brief recap - report has a query as a record source. The query shows the correct data, the report translating the...
7
by: manning_news | last post by:
I've got a report that's not sorting correctly. I build a SQL statement and assign it to the recordsource in the Open event, sorting the data the way the user chooses. The user can choose up to 3...
4
by: ApexData | last post by:
I have one table used to maintain information on Service Events. Each record contains a Repair, Maint, and Battery checkbox (bound/boolean). Any one of these fields may be checked or left empty....
4
by: DavidB | last post by:
Im not sure if I am missing something obvious here or not so excuse me if this is a DFU question please... I have a report I am working on that includes the following data. Agency Name Vendor...
4
by: zufie | last post by:
I have a report that return all the records (materials ordered) by all callers each day. I want the report to just show all the records (materials ordered) by each individual caller each day on...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.