Access 2000
I have a form that sources a subform for employees hours etc. I would like to total the most recent days hours in the subform in an unbound field. I am having trouble figuring out how to use the current recordset of the subform for this.
dim db as database ,rst as recordset, DayHrs as single, CompDate as date
?set rst = current recordset?
DayHrs=0
CompDate = DMax(rst!HoursDate)
rst.movefirst
Do Until rst.EOF
if rst!HoursDate = CompDate then
DayHrs = DayHrs + rst!HoursDetail
end if
rst.movenext
Loop
Unbound control = DayHrs
Any ideas? Maybe I'm thinking about this wrong.
Nishan
I have a form that sources a subform for employees hours etc. I would like to total the most recent days hours in the subform in an unbound field. I am having trouble figuring out how to use the current recordset of the subform for this.
dim db as database ,rst as recordset, DayHrs as single, CompDate as date
?set rst = current recordset?
DayHrs=0
CompDate = DMax(rst!HoursDate)
rst.movefirst
Do Until rst.EOF
if rst!HoursDate = CompDate then
DayHrs = DayHrs + rst!HoursDetail
end if
rst.movenext
Loop
Unbound control = DayHrs
Any ideas? Maybe I'm thinking about this wrong.
Nishan