Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Sunrise, Florida
    Posts
    324
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Hide/Reveal Controls (2003)

    Form "frmDisplayActions" has a "Tab Control" I called "tabActions". The first Tab I called "Case Information" and the second I called "Activities".

    "lblClosed" and "datClosedDate" sit on the "Case Information" Tab; "lblOpened", "strDaysOpened", "lblClosed2" and "strDaysClosed" sit on "Activities". The following code is in "frmDisplayActions" "On Load" event. When I load the form, the backcolor of the form and the "Visible" status of "lblClosed" and "datClosedDate" change as expected. However, I can't make "lblOpened", "strDaysOpened", "lblClosed2" and "strDaysClosed" behave as programmed. "lblOpened" and "strDaysOpened" "Visible" status is "Yes" by default. "lblClosed2" and "strDaysClosed" "Visible" status is set to "No" by default. I have played around with them to no avail. By the way, in design mode, "lblOpened" and "strDaysOpened" sit on top of "lblClosed2" and "strDaysClosed". Any suggestions appreciated. Thanks!

    - - - - - - - - - - - - - - - - - - - - -
    Private Sub Form_Load()
    Call ActInactAdjust
    End Sub

    Private Sub ActInactAdjust()

    Consumer.SetFocus

    If chkActive = False Then

    Me.Section(acDetail).BackColor = vbRed

    ' These two sit on the Tab called "Case Information"
    Me!lblClosed.Visible = True
    Me!datClosedDate.Visible = True

    ' These four sit on the Tab called "Activities"
    ' Of the four, the first two sit on top of the other two
    Me!lblOpened.Visible = False
    Me!strDaysOpened.Visible = False

    Me!lblClosed2.Visible = True
    Me!strDaysClosed.Visible = True

    End If

    End Sub
    - - - - - - - - - - - - - - - - - - - - -

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Hide/Reveal Controls (2003)

    I would add an Else section:

    If chkActive = False Then
    Me.Section(acDetail).BackColor = vbRed
    ' These two sit on the Tab called "Case Information"
    Me!lblClosed.Visible = True
    ...
    ...Else
    Me.Section(acDetail).BackColor = vbWhite
    Me!lblClosed.Visible = False
    ...
    ...
    End If

    If that doesn't work, you'll have to tell us exactly how you "can't make ... behave as programmed".

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Sunrise, Florida
    Posts
    324
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hide/Reveal Controls (2003)

    Hans ... Please disregard this post. The error was mine, not the logic. Thanks, Hans!

Posting Permissions

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