Check Box and Label

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
 
A

Allen Browne

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

No code needed.
 
T

TeeSee

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top