473,796 Members | 2,751 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Missing data on a grouped/sorted report

1 New Member
Hi,

I am having a problem with dynamically sorting/grouping data in my report at runtime. My problem is that when the report is run using sorting/grouping I am missing data.

Specifically, my situation is that I have a query that contains results from 2 tables that have a one to many relationship to each other (ex. 1=Contact, M=Contact Incident, 1 Contact can have multiple Contact Incidents). This query is the dataset for my report.

I want to be able to sort by fields from both “Contact” and “Contact Incident.” I have the following code on the “On Open” event of my report:

Me.GroupLevel(0 ).ControlSource = “<Contact field name goes here>”
Me.GroupLevel(1 ).ControlSource = “<Contact Incident field name goes here>”

In the report, I have two default group headers, “Groupheader1” (corresponding to Contact) and “Groupheader2” (corresponding to Contact Incident) which are preset to sort by Contact primary key and Contact Incident primary key.

The user decides which fields to sort by on a secondary selection form.

My problem is that when I open the report, I am missing records from the report. I have noticed two things: 1) if the record has a null entry in a field that I sorted by (ex. CONTACT_NAME, 80% of the time it will not show up 2) occasionally, the record belonging to “Contact” will not appear on the report, but the “Contact Incident” fields will appear but they will be shown belonging to another “Contact.”

This is kind of a bizarre error. I tried looking at the query itself, and all the records are shown. If I do not run any sorting or grouping on the report, all the records are displayed. I tried putting a textbox databound to “Count=(*)” on my report however the record count does not go down, even when I am missing records.

I have done some research and from what I read it seems that access is “combining” two of my rows and subsequently “hiding” the data.

Any ideas? Thanks in advance.
Aug 17 '07 #1
1 4146
dima69
181 Recognized Expert New Member
Hi,

I am having a problem with dynamically sorting/grouping data in my report at runtime. My problem is that when the report is run using sorting/grouping I am missing data.

Specifically, my situation is that I have a query that contains results from 2 tables that have a one to many relationship to each other (ex. 1=Contact, M=Contact Incident, 1 Contact can have multiple Contact Incidents). This query is the dataset for my report.

I want to be able to sort by fields from both “Contact” and “Contact Incident.” I have the following code on the “On Open” event of my report:

Me.GroupLevel(0 ).ControlSource = “<Contact field name goes here>”
Me.GroupLevel(1 ).ControlSource = “<Contact Incident field name goes here>”

In the report, I have two default group headers, “Groupheader1” (corresponding to Contact) and “Groupheader2” (corresponding to Contact Incident) which are preset to sort by Contact primary key and Contact Incident primary key.

The user decides which fields to sort by on a secondary selection form.

My problem is that when I open the report, I am missing records from the report. I have noticed two things: 1) if the record has a null entry in a field that I sorted by (ex. CONTACT_NAME, 80% of the time it will not show up 2) occasionally, the record belonging to “Contact” will not appear on the report, but the “Contact Incident” fields will appear but they will be shown belonging to another “Contact.”

This is kind of a bizarre error. I tried looking at the query itself, and all the records are shown. If I do not run any sorting or grouping on the report, all the records are displayed. I tried putting a textbox databound to “Count=(*)” on my report however the record count does not go down, even when I am missing records.

I have done some research and from what I read it seems that access is “combining” two of my rows and subsequently “hiding” the data.

Any ideas? Thanks in advance.
I suspect a logic mistake here. When you try to group by a field which is not unique in your table, you actually get one group header for all (different) records with the same field value. I guess what you really want is to sort the report without affecting the groups.
So I suggest you to leave the actuall group headers with their primary keys, and add two more group levels - just for sorting, without showing group headers.
Something like this:
Expand|Select|Wrap|Line Numbers
  1. Me.GroupLevel(0).ControlSource = “<Contact sorting field name goes here>”
  2. Me.GroupLevel(1).ControlSource = “<Contact primary key goes here>”
  3. Me.GroupLevel(2).ControlSource = “<Contact Incident sorting field name goes here>”
  4. Me.GroupLevel(3).ControlSource = “<Contact Incident primary key goes here>”
while Group Levels 1 and 3 are actually show group headers, Group Levels 0 and 2 are for sorting.
Aug 17 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
427
by: CSDunn | last post by:
Hello, I have a format issue on an Access 2000 ADP report that I am going to attempt to explain from a 'ten thousand foot view' : I have an Access 2000 ADP report that has a SQL Server 2000 Stored Procedure as its record source. The Proc is called MM_rptTeacherGroupingTest_sp. In order to help communicate the issue I am having with the report, please take a look at the following: http://www.valverde.edu/home/policy/ReportLayout.htm .
2
2666
by: Melissa | last post by:
I have a grouped report that starts a new page at each group. All the field labels for the report are in the group header because there is a subreport in the top part of the report that needs to grow (The subreport can't grow in the page header!). Each page holds 21 records. I need the labels on each page so I set the Repeat property of the group header to Yes. When a group has 42 records, I get two pages of records with the labels at the...
1
2360
by: Melissa | last post by:
Can anyone help me with this --- I have a grouped report with a subreport in the group footer and the report starts a new page for each group. The subreport is based on a query which has criteria in one of the fields. I have a function in a standard module where the value of the function is part of the criteria. For each group, I need to run the function and have the query requery so the subreport prints the correct records. Where do I...
1
1708
by: Randy | last post by:
I have trying to figure out the above topic. Can someone help me with this? I need for staff to be able to go to a dialog box or a form and then be able to enter data in mutliple fields and then pull up a report. I have tried parameter queries but it does not seem to work in a grouped report. I put text boxes on the report but that did not work either using a query and the text box. Please something simple as possible as I am new...
0
1772
by: Chris | last post by:
I finally got my report to be recongized, that login issue is terrible. Using VS.NET 2003, created report inside of it. Now when I attempt to display the report is blank (missing data, though I can see the viewer, report fields, etc.) I've tried setting the rpt.SetDataSource(dstConcernInfo) in the reports VB code behind and my viewer code-behind page. No luck. I've displayed my dataset to see that it's full. I assume that the report can't...
1
3892
by: jjjoic | last post by:
Hi, I use Access 2003 to generate the back-end data for a ColdFusion report at work. The report is sorted by a column and based on the sorting, rankings are assigned to each row(i.e. the biggest value gets No. 1, and then the row of the second biggest value is ranked as No. 2). Each task owners will then have to attack their owning issues based on the ranking. The No. 1, 2, 3,... rankings are generated in this way: 1. An...
3
9701
by: yovation | last post by:
Hi, I have a 3 table database. 1 parent 1 child 1 child of child I would like to get the data into excel as 1 sheet (similar to a grouped report).
1
1402
by: regrat | last post by:
Good Morning, I'm making a report with grouped data with access 2003. Unfortunately, Access print in this report groups with empty data to fulfill all level. It's possible not to print groups level which haven't data? Thanks
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
9685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9535
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
10467
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...
1
10201
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
9061
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
5582
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4130
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
3744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2931
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.