Dsum with multiple Criteria not working

Joined
Sep 2, 2014
Messages
1
Reaction score
0
Dear Friends

I have a table which has Personnel information (Parent table) and another child table which has their leave or vacation information (Child table)

I have created a form and subform based on these tables and I have a textbox which must show the number of Days an employee has left the work

I need two criteria in my Dsum

1: PersonnelID must be the same of the Current Record

2: LeaveID (Autonumber) must be less than the Current Leave ID (because in each record we need the sum of previous leaves or vacations)

I use below syntax but it sums all the LeaveDay records of tbl_Leave not for the current Personnel and his/her previoud records.

=DSum("LeaveDay";"tbl_Leave";("[PersonnelId]=" & [PersonnelID]) And ("[LeaveID]<" & [LeaveID]))


Please help me
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top