arfox
New member
- Local time
- Today, 08:13
- Joined
- May 30, 2004
- Messages
- 5
Hello all-
I have what I thought was a simple programming problem... but I think I am going about it the wrong way as the solution has turned into a disaster.
Basically I have a form called "frmworkCallSub" that users can use to enter scheduling information for employees. There is an employeeID field, Date, StartTime(in Short Time), EndTime(in Short Time), and other details.
I have on the form a calculated control to find the total time for each individual record, or "work call"
TotalTimePerCall=Format([StartTime]-1-[EndTime],"Short Time")
What I am trying to do is calculate the total number of hours for each employee over a specified date period.
I set up a query taking the "TotalTimePerCall" and EmployeeID, and an empty field called "HourTotal" I then wrote a function that loops through each employeeID and calculates a running sum. (HOURS worth of work on freakin' date/time syntax mind you!) However, when I try to run the sql statement in the function to update the "HourTotal" field- it updates that field for EVERY record in the query. i end up with the total for my first employee in EVERY employee.
Obviously I'm doing something wrong. Is there a way to only update the current record?
Help??
Thanks!
I have what I thought was a simple programming problem... but I think I am going about it the wrong way as the solution has turned into a disaster.
Basically I have a form called "frmworkCallSub" that users can use to enter scheduling information for employees. There is an employeeID field, Date, StartTime(in Short Time), EndTime(in Short Time), and other details.
I have on the form a calculated control to find the total time for each individual record, or "work call"
TotalTimePerCall=Format([StartTime]-1-[EndTime],"Short Time")
What I am trying to do is calculate the total number of hours for each employee over a specified date period.
I set up a query taking the "TotalTimePerCall" and EmployeeID, and an empty field called "HourTotal" I then wrote a function that loops through each employeeID and calculates a running sum. (HOURS worth of work on freakin' date/time syntax mind you!) However, when I try to run the sql statement in the function to update the "HourTotal" field- it updates that field for EVERY record in the query. i end up with the total for my first employee in EVERY employee.
Obviously I'm doing something wrong. Is there a way to only update the current record?
Help??
Thanks!