Please open the DDrive Doc to read my question. Thank you.
10 1051
Please post your question in the thread itself. As a general rule of thumb, I do not open files from strangers.
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.
Please show us the query.
I am trying to copy/paste it but its not working, the paste option is grayed out
You can press ctrl+v to paste something that you've copied.
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.
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: - 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]
-
FROM DisciplineT INNER JOIN [Master Roster] ON DisciplineT.[Employee #] = [Master Roster].Employee
-
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]
-
HAVING (((DisciplineT.Incidents)="collision" Or (DisciplineT.Incidents)="injury" Or (DisciplineT.Incidents)="Roadside Inspection"));
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.
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
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?
Sign in to post your reply or Sign up for a free account.
Similar topics
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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
|
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...
|
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...
|
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...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
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...
|
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...
|
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)...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
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
|
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...
|
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...
| |