473,394 Members | 1,715 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,394 software developers and data experts.

Missing data on a grouped/sorted report

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 4107
dima69
181 Expert 100+
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
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...
2
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...
1
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...
1
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...
0
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...
1
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...
3
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
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...
14
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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...
0
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...
0
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...

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.