I apologize for leaving out vital info....my form is design to record all the
accidents that happens in our county. I have 3 fields that is missing data in
the query only. Injuires by department, injuries by employee and total
injuries. In the form I use the count function to get the results I need and
it works perfectly but in the query I am getting all 1. Here is my qry sql:
SELECT [tbl Employee Accidents].[EmployeeID#], [tbl Employee
Accidents].Name, [tbl Employee Accidents].Address, [tbl Employee
Accidents].City, [tbl Employee Accidents].ZipCode, [tbl Employee
Accidents].DOB, [tbl Employee Accidents].[Department:], [tbl Employee
Accidents].[Job Title:], [tbl Employee Accidents].[Location of Accident],
[tbl Employee Accidents].[Date of Injury:], [tbl Employee Accidents].[Time of
Injury:], [tbl Employee Accidents].[Date Employer Notified:], [tbl Employee
Accidents].[Type of Injury:], [tbl Employee Accidents].[Part of Body
Affected:], [tbl Employee Accidents].Summary, [tbl Employee Accidents].[No
Treatment], [tbl Employee Accidents].[Minor: By Employee], [tbl Employee
Accidents].[Minor: Clinic/ER], [tbl Employee Accidents].[Emergency Care],
[tbl Employee Accidents].[Hospitalized 24hrs], [tbl Employee
Accidents].[Hospital/Physician], [tbl Employee Accidents].[Hospital/Physician
Address], [tbl Employee Accidents].[Report Prepared By:], [tbl Employee
Accidents].Telephone, [tbl Employee Accidents].[Date Reported], Count([tbl
Employee Accidents].[Total Injuries by Department]) AS [CountOfTotal Injuries
by Department], Count([tbl Employee Accidents].[Total Injuries by Employee])
AS [CountOfTotal Injuries by Employee], Count([tbl Employee Accidents].[Total
Injuries:]) AS [CountOfTotal Injuries:], [tbl Employee
Accidents].[EmployeeID#]
FROM [tbl Employee Accidents]
GROUP BY [tbl Employee Accidents].[EmployeeID#], [tbl Employee
Accidents].Name, [tbl Employee Accidents].Address, [tbl Employee
Accidents].City, [tbl Employee Accidents].ZipCode, [tbl Employee
Accidents].DOB, [tbl Employee Accidents].[Department:], [tbl Employee
Accidents].[Job Title:], [tbl Employee Accidents].[Location of Accident],
[tbl Employee Accidents].[Date of Injury:], [tbl Employee Accidents].[Time of
Injury:], [tbl Employee Accidents].[Date Employer Notified:], [tbl Employee
Accidents].[Type of Injury:], [tbl Employee Accidents].[Part of Body
Affected:], [tbl Employee Accidents].Summary, [tbl Employee Accidents].[No
Treatment], [tbl Employee Accidents].[Minor: By Employee], [tbl Employee
Accidents].[Minor: Clinic/ER], [tbl Employee Accidents].[Emergency Care],
[tbl Employee Accidents].[Hospitalized 24hrs], [tbl Employee
Accidents].[Hospital/Physician], [tbl Employee Accidents].[Hospital/Physician
Address], [tbl Employee Accidents].[Report Prepared By:], [tbl Employee
Accidents].Telephone, [tbl Employee Accidents].[Date Reported], [tbl Employee
Accidents].[EmployeeID#];
I hope I gave enough information, thanks
LHEMA
Jeff Boyce said:
Without some idea of:
your data structure;
your form design
your query SQL
your filter
it will be tough to offer anything specific.
A general approach would be to start at the query and keep taking pieces
out/simplifying until it does what it should, then building back up one step
at a time, confirming at each step.
--
Regards
Jeff Boyce
<Office/Access MVP>
I have a form that works great, it counts the items that are needed for my
report. The problem that I am having is when I open my query to check my
totals they are not there, each field is empty. I filter my form from the
query so all the data that is in my form should be in the query. I need
help
at this point, I have no clue of what I did wrong. Can someone please help
me