473,327 Members | 2,016 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,327 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, 288 views)
Jan 28 '15 #1
10 1051
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.