Hi,
I'm trying to use Yes/No fields to represent the days of the week with the toggle reflecting whether work was performed on a day. I want to be able to count the Yes/True responses and then use this number as a multiplier.
I'm assuming this needs to be done with code, and I'm guessing it's pretty simple - but I can't seem to get it to work. Below is what I've tried. I've declared the var earlier.
Private Sub TotalDaysPerWeek_AfterUpdate()
If [Monday] = "Y" Then GetValM = 1 Else GetValM = 0
If [Tuesday] = "Y" Then GetValT = 1 Else GetValT = 0
If [Wednesday] = "Y" Then GetValW = 1 Else GetValW = 0
If [Thursday] = "Y" Then GetValTh = 1 Else GetValTh = 0
If [Friday] = "Y" Then GetValF = 1 Else GetValF = 0
[TotalDaysPerWeek] = GetValM + GetValT + GetValW + GetValTh + GetValF + 1
Thank you.
I'm trying to use Yes/No fields to represent the days of the week with the toggle reflecting whether work was performed on a day. I want to be able to count the Yes/True responses and then use this number as a multiplier.
I'm assuming this needs to be done with code, and I'm guessing it's pretty simple - but I can't seem to get it to work. Below is what I've tried. I've declared the var earlier.
Private Sub TotalDaysPerWeek_AfterUpdate()
If [Monday] = "Y" Then GetValM = 1 Else GetValM = 0
If [Tuesday] = "Y" Then GetValT = 1 Else GetValT = 0
If [Wednesday] = "Y" Then GetValW = 1 Else GetValW = 0
If [Thursday] = "Y" Then GetValTh = 1 Else GetValTh = 0
If [Friday] = "Y" Then GetValF = 1 Else GetValF = 0
[TotalDaysPerWeek] = GetValM + GetValT + GetValW + GetValTh + GetValF + 1
Thank you.