lblMON is a static label that shows the day of the week (Mon, Tue, etc.)
chkMONPD is bound to the table (for a yes/no field)
lblMONPD is the label to show the fancy checkmark. NOTE : I have a different label for each day, lblTUEPD, etc. The following example is for a Monday.
The OnClick for the lblMONPD label is this:
CODE
Call CheckPD("MON")
which calls this:
CODE
Private Sub CheckPD(strDay)
Me.Controls("chk" & strDay & "PD") = Not Me.Controls("chk" & strDay & "PD")
If Controls("chk" & strDay & "PD") = True Then
Controls("lbl" & strDay & "PD").Caption = Chr(252)
Else
Controls("lbl" & strDay & "PD").Caption = " "
End If
End Sub
Me.Controls("chk" & strDay & "PD") = Not Me.Controls("chk" & strDay & "PD")
If Controls("chk" & strDay & "PD") = True Then
Controls("lbl" & strDay & "PD").Caption = Chr(252)
Else
Controls("lbl" & strDay & "PD").Caption = " "
End If
End Sub
and this is the OnCurrent for the form:
CODE
Dim arrDays
Dim strDay
arrDays = Array("MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN")
For Each strDay In arrDays
If IsNull(txtNumber.Value) Then
Me.Controls("lbl" & strDay & "PD").Visible = False
Else
Me.Controls("lbl" & strDay & "PD").Visible = True
If Me.Controls("chk" & strDay & "PD") = True Then
Me.Controls("lbl" & strDay & "PD").Caption = Chr(252)
Else
Me.Controls("lbl" & strDay & "PD").Caption = " "
End If
End If
Next
Dim strDay
arrDays = Array("MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN")
For Each strDay In arrDays
If IsNull(txtNumber.Value) Then
Me.Controls("lbl" & strDay & "PD").Visible = False
Else
Me.Controls("lbl" & strDay & "PD").Visible = True
If Me.Controls("chk" & strDay & "PD") = True Then
Me.Controls("lbl" & strDay & "PD").Caption = Chr(252)
Else
Me.Controls("lbl" & strDay & "PD").Caption = " "
End If
End If
Next
Is it not possible to have a different caption for the label for each record ?