473,799 Members | 3,350 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Report - totals

My query looks like this:
ID Docs
1 A
1 B
1 C
2 A
2 C
My report looks like this:
ID Docs
1
A
B
C
2
A
C

Now, I need the total number of IDs at the report header. How can I do
that? In this example it's two IDs. Please help. Thanks!

Jun 19 '07 #1
3 1430
On Tue, 19 Jun 2007 09:59:34 -0700, ty******@gmail. com wrote:
>My query looks like this:
ID Docs
1 A
1 B
1 C
2 A
2 C
My report looks like this:
ID Docs
1
A
B
C
2
A
C

Now, I need the total number of IDs at the report header. How can I do
that? In this example it's two IDs. Please help. Thanks!
I'm not sure that the Report will give you this information; I checked the properties of the Report and Group and
couldn't find where this was reported. Someone else may have another idea, however.

You can always use a Query to fill this data. For example, build a query something like this, perhaps in the Open event
of your report:

Sub Report_Open()

Dim rst As ADODB.Recordset

Set rst = New ADODB.Recordset
rst.OPEN "SELECT DISTINCT Count(ID) AS RecCount FROM YourTableName WHERE [your where clause here]",
CurrentProject. Connection

Me.YourTotalBox = rst("RecCount")
Set rst = NOthing

End Sub

Scott McDaniel
scott@takemeout _infotrakker.co m
www.infotrakker.com
Jun 20 '07 #2
Hi,
your example looks like you are grouping by ID and listing Docs. I
would think you can just Count(Docs) since there appears to be a one-
for-one
bobh.

On Jun 19, 12:59 pm, tyryn...@gmail. com wrote:
My query looks like this:
ID Docs
1 A
1 B
1 C
2 A
2 C
My report looks like this:
ID Docs
1
A
B
C
2
A
C

Now, I need the total number of IDs at the report header. How can I do
that? In this example it's two IDs. Please help. Thanks!

Jun 21 '07 #3
On Jun 19, 11:59 am, tyryn...@gmail. com wrote:
My query looks like this:
ID Docs
1 A
1 B
1 C
2 A
2 C
My report looks like this:
ID Docs
1
A
B
C
2
A
C

Now, I need the total number of IDs at the report header. How can I do
that? In this example it's two IDs. Please help. Thanks!
Here's a shot in the dark. Suppose your query has the following SQL:

MyQuery: SELECT ID, Docs FROM tblSupportingDo cumentation;

MyReport.Record Source: MyQuery

MyReport SortingAndGroup ing Field/Expression ID

Detail Section: Docs

MyQueryCount:
SELECT ID FROM MyQuery GROUP BY ID;

!MyQueryCount:
ID
1
2

MyCountQuery:
SELECT Count(MyQueryCo unt.ID) AS MyCount
FROM MyQueryCount;

!MyCountQuery:
MyCount
2

Textbox ControlSource in Report Header:

=DLookUp("[MyCount]","[MyCountQuery]")

Those two queries can be combined using syntax I don't like:

qryAlsoTry:

SELECT Count(*) AS IDCount FROM [SELECT DISTINCT ID AS DistinctID FROM
tblSupportingDo cumentation]. qryDistinct;

or

SELECT Count(*) AS IDCount FROM [SELECT DISTINCT ID AS DistinctID FROM
MyQuery]. qryDistinct;

with

=DLookUp("[IDCount]", "[qryAlsoTry]")

There may be better ways to do this.

James A. Fortune
CD********@Fort uneJames.com

Jun 22 '07 #4

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

Similar topics

3
2109
by: John Baker | last post by:
Hi: I have a situation where I have a series of time records (one or more per day) for a number of projects. Each record has an identification for the activity conducted during the period recorded. For any project, the activity may be one of many things, and the activities may vary by project number. I need to run a report and end up with a list of all the times reported, and totals by the project number and the activity, as well as...
2
4260
by: Steven Stewart | last post by:
Hi there, I don't have a lot of experience with this so I am looking for some help. I have a form that allows a user to choose the options she wants. How do I set it up so that the report generated reflects those options? Another issue is that I want the report to show totals. These totals are organized with columns "Programs" and "Levels of Processing." The
1
17681
by: Nathan Bloomfield | last post by:
Does anyone know if there is any documentation which relates to Access2k + ? or can anyone help adjust the code? I am having trouble converting the DAO references. TITLE :INF: How to Create a Dynamic Crosstab Report PRODUCT :Microsoft Access PROD/VER:1.00 1.10 OPER/SYS:WINDOWS
1
4516
by: fixedpower | last post by:
I have an Access 2000 DB for a financial company. I have the table structure completed, but I am having trouble with the report. Basically, I have a Client tbl, a StockShares tbl, and a StockOptions tbl. One client can have many types of StockShares and StockOptions. I need to detail the StockShares and StockOptions on one page. The hierarchy should look like this: CLIENT NAME StockShares
8
2206
by: sara | last post by:
Hi - I have looked at all posts and tried both Allen Browne's Report Sorting at run Time ( Select Case Forms!frmChooseSort!grpSort Case 1 'Name Me.GroupLevel(0).ControlSource = "LastName" Me.GroupLevel(1).ControlSource = "FirstName") ..... And another post that was OrderByOn = True and setting the sort Order.
4
3137
by: lorirobn | last post by:
Hi, I have a report displaying items that are missing from a room. I created 2 queries, the first getting the items IN the room, and the second being an "unmatched" query that references the first query where Item is Null. I use a subreport for the details, and the results display correctly. However, the Report_Details event of the subreport is executed about 2 or 3 times more than I would expect (I think 3 times when I have a
4
5665
by: Micheal | last post by:
Greetings Access Group, Being relatively new to Access, I try to work through problems on my own and have been very successful, although I have a conundrum that I have been working on for two days (total 10 hours) and I have yet to resolve it. please excuse me for my lack of terminology, I will try to provide you with the best of information. I currently have a report that contains 2 totals and the percentage of the difference of the 2...
5
3951
prn
by: prn | last post by:
Hi folks, I'm looking for a little advice here. I need to create a report that is totals only, with no detail records. I have a database with a lot of individuals (people) and the report has to have some overall totals, totals per state, totals by gender, race/ethnicity, and several other criteria. This report does not need to (and should not) report on each individual, just the totals. I can create expressions for each of the items I...
0
1314
by: zufie | last post by:
Hi, Here are the specifics of the Report which I am to create. Reports for Callers - from Begin Date to End Date of Reporting Period and by respective County: * List Language preference of Callers - Top 4 languages and their respective totals. * Age Range of Callers - (18 yrs and under, 18-24 yrs, 25-44 yrs, 45-64 yrs, greater than or equal to 65 yrs) - And their their
14
7863
ollyb303
by: ollyb303 | last post by:
Hi, I am trying to create a dynamic crosstab report which will display number of calls handled (I work for a call centre) per day grouped by supervisor. I have one crosstab query (Query1) which has the following fields: SPID (supervisor ID), total:group by, as row heading Date, total:group by, as column heading Calls handled, total:sum, as value Date, total:where, criteria between and - this is taken from a form,
0
10490
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10259
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...
0
10030
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9077
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
6809
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
5467
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...
1
4145
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
2
3761
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2941
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.