I would personally go with 1 control for each WeekDay & 1 for unspecified &
add up into a locked field for the total to avoid
to many unwanted "duplicates"
If so Create 9 Controls Named Day1 Through Day9 (label them according to
your weekday calendar Sun .. Sat,Other,Total)
Create a Sub on the Form:
Sub CalcTotalHours()
Dim C as Access.Control
Dim i As Integer, TotHours As Integer
Access.Application.screen.MousePointer = 11 ' I tend to avoid Docmd
whenever I Can ;-)
For i =1 To 8 ' I'm lazy .....
Set C = Me.Controls("Day" & i)
TotHours = TotHours + Nz(C.Value,0) ' Must Handle Null's correctly
C.Value = Null ' if you want to clear it
Next
Me.Controls("Day9").Value = TotHours
Set C = Nothing ' I always try to make sure to realease all pointers to
objects - but usually fail miserably due 2 lack of time..
End Sub
Now you have two options (3 if you convert it to a function & use it as a
controlsource for "Day9")
1) Create an After_Update Event Proc for days 1..8 & place a ref to the sub
there
2) Create a Command Button & put it in the Click Events Procedure ...
HTH
Pieter
Joan said:
I get the following error: "Member already exist in an object module from
which this object module drives."
And just so that im clear. I want the totals of the days of the week to
be Added to the number already in Current Hours. Also, Is it possible to
removes the numbers that were inputed in the days of the weeks after update?