J
Jeff Garrison
I have a form that tracks vacation hours accrued and taken. The Fields are
as follows:
Week Period End Date Accrued Hours Hours Taken Balance
1 12/26/07 3.08 0.0
2 1/9/08 3.08 0.0
3 1/23/08 3.08 0.0
4 2/6/08 3.08 8.0
Since I don't want to store a calculated field in my table, I need to have
the Balance field total the number of Accrued Hours less the Hours Taken for
each week. My thinking is to use DSum to get the info, but based on the
statement I'm using below, I'm getting the same value (3.08) as the balance
for each week
vba statement:
Balance = DSum("[vacationAccrual]", "tblEmployeeVacation", "[vacationWeek]
<= " & [vacationWeek] & " And [vacationEmployeeNumber]= " &
[vacationEmployeeNumber] & " And [vacationYear]= " & [vacationYear] & "")
tblEmployeeVacation is the table that stores the Accrued Hours and Hours
Taken
vacationYear is the Year, taken from the form
vacationEmployeeNumber is the Employee Number taken from the form as well.
Am I missing something obvious?
Thanks.
Jeff
I have a form that tracks vacation hours accrued and taken. The Fields are
as follows:
Week Period End Date Accrued Hours Hours Taken Balance
1 12/26/07 3.08 0.0
2 1/9/08 3.08 0.0
3 1/23/08 3.08 0.0
4 2/6/08 3.08 8.0
Since I don't want to store a calculated field in my table, I need to have
the Balance field total the number of Accrued Hours less the Hours Taken for
each week. My thinking is to use DSum to get the info, but based on the
statement I'm using below, I'm getting the same value (3.08) as the balance
for each week
vba statement:
Balance = DSum("[vacationAccrual]", "tblEmployeeVacation", "[vacationWeek]
<= " & [vacationWeek] & " And [vacationEmployeeNumber]= " &
[vacationEmployeeNumber] & " And [vacationYear]= " & [vacationYear] & "")
tblEmployeeVacation is the table that stores the Accrued Hours and Hours
Taken
vacationYear is the Year, taken from the form
vacationEmployeeNumber is the Employee Number taken from the form as well.
Am I missing something obvious?
Thanks.
Jeff
as follows:
Week Period End Date Accrued Hours Hours Taken Balance
1 12/26/07 3.08 0.0
2 1/9/08 3.08 0.0
3 1/23/08 3.08 0.0
4 2/6/08 3.08 8.0
Since I don't want to store a calculated field in my table, I need to have
the Balance field total the number of Accrued Hours less the Hours Taken for
each week. My thinking is to use DSum to get the info, but based on the
statement I'm using below, I'm getting the same value (3.08) as the balance
for each week
vba statement:
Balance = DSum("[vacationAccrual]", "tblEmployeeVacation", "[vacationWeek]
<= " & [vacationWeek] & " And [vacationEmployeeNumber]= " &
[vacationEmployeeNumber] & " And [vacationYear]= " & [vacationYear] & "")
tblEmployeeVacation is the table that stores the Accrued Hours and Hours
Taken
vacationYear is the Year, taken from the form
vacationEmployeeNumber is the Employee Number taken from the form as well.
Am I missing something obvious?
Thanks.
Jeff
I have a form that tracks vacation hours accrued and taken. The Fields are
as follows:
Week Period End Date Accrued Hours Hours Taken Balance
1 12/26/07 3.08 0.0
2 1/9/08 3.08 0.0
3 1/23/08 3.08 0.0
4 2/6/08 3.08 8.0
Since I don't want to store a calculated field in my table, I need to have
the Balance field total the number of Accrued Hours less the Hours Taken for
each week. My thinking is to use DSum to get the info, but based on the
statement I'm using below, I'm getting the same value (3.08) as the balance
for each week
vba statement:
Balance = DSum("[vacationAccrual]", "tblEmployeeVacation", "[vacationWeek]
<= " & [vacationWeek] & " And [vacationEmployeeNumber]= " &
[vacationEmployeeNumber] & " And [vacationYear]= " & [vacationYear] & "")
tblEmployeeVacation is the table that stores the Accrued Hours and Hours
Taken
vacationYear is the Year, taken from the form
vacationEmployeeNumber is the Employee Number taken from the form as well.
Am I missing something obvious?
Thanks.
Jeff