Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2004
    Posts
    193

    Unanswered: Toggle Visibility of an Object Multiple Times

    Can someone provide syntax for toggling the visibility of an object when a checkbox is clicked and unclicked, ie

    If chkReportA.Value = 1 Then
    cboSection1.visible = False
    Else: cboSection1.visible = True
    End If

    I am not quite getting it right. I would like to be able to select the checkbox repeatedly and have the combobox disappear and reappear multiple times. Is this possible?

    ddave

  2. #2
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    1,848
    Code:
    cboSelection1.visible = (chkReportA.Value = vbChecked)
    Rather than mess around with an IF statement, the right side of the above expression results in a boolean (true or false) value, which is then applied to the combo box's visible property. (the parens aren't needed - I just included them for clarity)
    Lou
    使大吃一惊
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •