473,695 Members | 1,815 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.RecordSo urce="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 7316
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******@pcdata sheet.com
www.pcdatasheet.com
"David Horowitz" <da***@soundsid esoftware.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.RecordSo urce="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
2153
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 considered to be original if it does *not* match the regular expression /^\s{0,3}(?:>|:|\S+>|\+\+)/. - All text after the last cut line (/^-- $/) in the body is
11
3884
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 could I sort it as: Low, Medium, High? Any suggestion is greatly appreciated, James
7
8859
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 want my users to be able to select a report, click on a command button on a form, which will then automatically create the report as a pdf file and save it to the user's machine. I am using Adobe Acrobat (5.0 I think) and have Adobe Distiller as a
11
6593
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 where the job is running, the job runs sucessfully, PDF files got generated, everything is good. If I scheduled the job to run at the time that I am not logged into the server, Access is not able to print to the printer. The error is pretty...
2
1947
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 text in one field into numbers. The field in question uses a NZ function. They query is an aggregate query with the field in question using the First operator. After additional troubleshooting, I have found the following...
7
2415
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 sorts using a form that opens before the report opens. When the report previews, it ignores the users' sort request and always sorts by the primary key even though ORDER BY is explicity set to another field other than primary key. If I copy...
4
4605
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. Ex. REPAIR=True, MAINT=False, BATTERY=True I want to generate ONE report that lists all the REPAIRS, then lists all the MAINT, and then lists all the BATTERY events. One group after the other in the same report. Because (ex. REPAIR and BATTERY)...
4
3915
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 Name Contract Number Contract Description Agencies can have (and often do have) multiple contracts. I want my
4
1879
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 a separate page. I tried Hide Duplicates property, Force New Page all to no success. Here is the code to my qry/record source for my report:
0
8565
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8977
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8839
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7656
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5837
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4339
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4577
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2997
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
1971
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.