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

Getting totals for different entries in a field

9
Please open the DDrive Doc to read my question. Thank you.
Attached Files
File Type: docx DDrive.docx (46.3 KB, 289 views)
Jan 28 '15 #1
10 1053
Rabbit
12,516 Expert Mod 8TB
Please post your question in the thread itself. As a general rule of thumb, I do not open files from strangers.
Jan 28 '15 #2
Sackey
9
i have the field (incidenS)from a table. This field have different entries for each employee (collision, injury, inspection). i am trying to figure out a way to get a total for each entry (total collision, total injury, total inspection)for each employee, and put the individual totals in a form. I tried creating a query to add them up, but when i enter them on the form i get the word 'error' in its place.Some help/advise will be greatly appreciated. Thank you.

PS: I did create a query doing a count, that did give me totals for each (collision, injury, inspection), but i get the asme 'error' when i try to include it in the form.
Jan 30 '15 #3
Rabbit
12,516 Expert Mod 8TB
Please show us the query.
Jan 30 '15 #4
Sackey
9
I am trying to copy/paste it but its not working, the paste option is grayed out
Feb 1 '15 #5
Rabbit
12,516 Expert Mod 8TB
You can press ctrl+v to paste something that you've copied.
Feb 1 '15 #6
Sackey
9
I had already tried that (ctrl+c ctrl+v) and it did not work, I even try to copy/past using the snipping tool, but nothing seem to work.
Feb 1 '15 #7
Sackey
9
The only way that I can get it to copy/paste is to show it in SQL View which I am not to familiar with, If that will help you in anyway, the following is the SQL VIEW. Thank You.

SQL VIEW:

Expand|Select|Wrap|Line Numbers
  1. SELECT [Master Roster].Employee, [Master Roster].[Last Name], [Master Roster].[First Name], DisciplineT.Incidents, [Master Roster].[Adj Hire Date], [Master Roster].[Job Description], [Master Roster].[User Level], Count(DisciplineT.Incidents) AS [CountOfInjury/Collision/Roadside Inspection]
  2. FROM DisciplineT INNER JOIN [Master Roster] ON DisciplineT.[Employee #] = [Master Roster].Employee
  3. GROUP BY [Master Roster].Employee, [Master Roster].[Last Name], [Master Roster].[First Name], DisciplineT.Incidents, [Master Roster].[Adj Hire Date], [Master Roster].[Job Description], [Master Roster].[User Level]
  4. HAVING (((DisciplineT.Incidents)="collision" Or (DisciplineT.Incidents)="injury" Or (DisciplineT.Incidents)="Roadside Inspection"));
Feb 1 '15 #8
Rabbit
12,516 Expert Mod 8TB
The SQL view is what I meant. You can't copy and past a query object into a text box. Also, please use code tags when posting code or formatted data.

What do you mean you get an error when you "put it on a form"? You mean you set the query as the row source and tried to set the control sources to the fields in the query? If the query runs, then using the query as a row source shouldn't pose any problems.

I did notice some potential issues with your naming convention though. It's best to avoid spaces and other special characters when naming a table or a field, they tend to cause more trouble than anything.

Also, I'm not sure why you're trying to do this in a form. It's usually better to do this type of summary information in a report because a form is for entering data whereas a report is for viewing data. This type of summary query can only be viewed and can not be edited from a form so it's odd that you would want to put it in a form.
Feb 2 '15 #9
Sackey
9
The user wanted a form instead. They wanted to enter an employee number and have the rest of the form populate. i already have a report and the totals show up as they should, but when i use the query to populat th form most of th records are not showing up. i am aware of the naming convention, but was trying to get the form to work first
Feb 3 '15 #10
Rabbit
12,516 Expert Mod 8TB
You can do pretty much the same thing using a report.

How is the form set up? Are all the fields showing #ERROR#? Or just some, which ones? How are those fields set up? Is there any code running?
Feb 3 '15 #11

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

Similar topics

2
by: Benny | last post by:
Dear All, Suppose in the program a record is added to a table whose primary key is a identity field. If I really want to get the lastest value for that field after the insertion, is it the best...
11
by: David Messner | last post by:
Ok I know this is simple but the statement eludes me... I have a date field where I want the default value on the data entry form's date field to be the last date entered. I figure I can do this...
2
by: jballard | last post by:
Hello, I have a database set-up with a form and two subforms in it. I have one of the subforms (replacement parts) set-up where you can pick part numbers from a drop down box and also pick a...
4
by: New Guy | last post by:
I'm trying to work with a system that somebody else built and I am confounded by the following problem: There is a table of payments and a table of charges. Each client has charges and payments...
1
by: Stu | last post by:
Hi, I am trying to return the data key field value from a dataset when I select a row in a datagrid after the datagrid has been bound to a dataset. When I an the Edit, Update and Cancel row I...
3
by: RBirney | last post by:
When i load a form (frmcontract) in the program i write i can load a contract (cbocontract) as well as many other things, also in this form i can load another form to deal with expenditure...
3
jenkinsloveschicken
by: jenkinsloveschicken | last post by:
I apologize for the rudimentary post, however I have a bit of a problem. I have been tasked with developing reporting for a ticketing system. Development has provided me with a rough output form of...
2
lee123
by: lee123 | last post by:
is there a way to add up all the totals in a datagrid to make one total in a form ( not in the datagrid outside of the grid). like in a textbox. lee123
1
by: shenkel55 | last post by:
I am using Access 2003. I've been importing Excel 2003 spreadsheets using the wizard in Access for some time now. The spreadsheet does NOT have the column names in the 1st row, so the wizard names...
5
by: hassanhundal007 | last post by:
In my table the field of DateTime name is TIN. In this field DATE and TIME are shown for date I pass this query: SELECT DAY(TIN) FROM SHIFT WHERE SHID = 1 Then the result is "10". So the same I...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
0
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,...

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.