Please Help me in Access

reddy

New member
Local time
Today, 13:02
Joined
Apr 20, 2005
Messages
9
Hi Guys,
Iam doing an Access project And i have poblem in calculation in a form. This calculation basically is between a form and a table. I have form called "Yearly _Amount" in which there is a field called "Total_Hours". Now i want to calculate this Total_Hours as Sum of hours (Hours is record in "Time_Sheets" table) Where three fields are equal ie., Employee_#,Fiscal_Year and Project_# in Yearly_Amount form is equal to
Employee_#,Fiscal_Year and Project_# in Time_Sheets Table.

Waiting for reply
 
Not working

When Iam using this DSum() its just obtaining the total of hours but not cheking the criteria. I have been trying it for past two days using DSum() function.Its not checking the criterua for the three fields to be equal.Iam using expression builder to build this expression.
 
Have you tried running a query to group the hours by year before passing it onto the form? I don't know if that's gonna help.
 
Tried it

I tried that too. It is not helping me. Iam poor in queeries though. My entire project deals with the same thing. I mean summing the totals by checking the crteria. Hopefully i find an answer soon.
 
Form design->properties -> control Source

=DSum("[Hours]","[Time_Sheets]"," [Employee_#]"="Time_Sheets![Employee_#]") i have built this expression in the control source. but ti is not working.
 
This is the code. When iam not writing the criteria it is working properly. But when i write the criteria part Its giving error, shows "#Name?" in the particular field.



=DSum("[Hours]","[Time_Sheets]",[Employee_#]=Time_Sheets![Employee_#] And [Fiscal_Year]=Time_Sheets!Fiscal_Year And [Project_#]=Time_Sheets![Project_#])

Actual question is:
Iam doing an Access project And i have poblem in calculation in a form. This calculation basically is between a form and a table. I have form called "Yearly _Amount" in which there is a field called "Total_Hours".

Now i want to calculate this Total_Hours as Sum of "Hours" (Hours is record in "Time_Sheets" table) Where three fields are equal ie., Employee_#,Fiscal_Year and Project_# in Yearly_Amount form is equal to
Employee_#,Fiscal_Year and Project_# in Time_Sheets Table.
 
Try this for your criteria...
"Time_Sheets![Employee_#] = """ & [Employee_#] & """"

that's 3 quotations for the middle part, and 4 quotations for the last part. What that translates to is something like this:
Time_Sheets!Employee_# = "1234567890"

hope this works..
 
It says "the expression you entered has invalid syntax"
 

Users who are viewing this thread

Back
Top Bottom