Check Box and Label

  • Thread starter Thread starter TeeSee
  • Start date Start date
T

TeeSee

Hello All!. I am stumped on this one. I have code on the after update
event of this check box that changes the row source to suit. Here I am
trying to have the label (belongs to the check box) to read the
appropriate description of the records in the row source of the combo.
Could someone please clarify how one or both should be applied.

Thanks
Private Sub Form_Current()
-----------------------------------------------------------------------------
'If Me.chkAllProjects = False Then
' Me!lblListStatus.Caption = "Active Projects"
'Debug.Print lblListStatus.Caption
'Else
' Me!lblListStatus.Caption = "All Projects"
'Debug.Print lblListStatus.Caption
'End If
-----------------------------------------------------------------------------
Select Case chkAllProjects
Case True
Me!lblListStatus.Caption = "All Records"
Case False
Me!lblListStatus.Caption = "Open Records"
Case Else
'Do nothing
End Select
End Sub
 
Right-click the label, and Change To | Text Box.
Then set its Control Source to:
=IIf([chkAllProjects], "All", "Open") & " Records"

No code needed.
 
Right-click the label, and Change To | Text Box.
Then set its Control Source to:
    =IIf([chkAllProjects], "All", "Open") & " Records"

No code needed.
--
Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users -http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.




Hello All!. I am stumped on this one. I have code on the after update
event of this check box that changes the row source to suit. Here I am
trying to have the label (belongs to the check box) to read the
appropriate description of the records in the row source of the combo.
Could someone please clarify how one or both should be applied.
Thanks
Private Sub Form_Current()
---------------------------------------------------------------------------­--
   'If Me.chkAllProjects = False Then
   '    Me!lblListStatus.Caption = "Active Projects"
   'Debug.Print lblListStatus.Caption
   'Else
    '   Me!lblListStatus.Caption = "All Projects"
    'Debug.Print lblListStatus.Caption
   'End If
---------------------------------------------------------------------------­--
   Select Case chkAllProjects
   Case True
       Me!lblListStatus.Caption = "All Records"
   Case False
       Me!lblListStatus.Caption = "Open Records"
   Case Else
       'Do nothing
   End Select
End Sub- Hide quoted text -

- Show quoted text -

Yet another learning experience. Thanks Allen
 
Back
Top