Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2011

    Unanswered: Hiding Labels, boxes, and conrtols with a checkbox

    Hello everyone,

    It's been a while since I've messed with Access 07. But I'm trying to edit a form so that a box, a label, and a few bound text boxes and their associated labels are either hidden or visible based on whether or not a checkbox is checked or not. This is what I have for the VB Code

    Sub CheckHide()
    If CheckHide = False Then
    Box34.Visible = False
    Label35.Visible = False
    REDEP_POC_NAME.Visible = False
    REDEP_POC_ADDRESS.Visible = False
    REDEP_POC_PHONE.Visible = False
    Box34.Visible = True
    Label35.Visible = True
    REDEP_POC_NAME.Visible = True
    REDEP_POC_ADDRESS.Visible = True
    REDEP_POC_PHONE.Visible = True
    End If
    End Sub

    Basically I had the label, box and three text boxes hidden by default and was hoping that this code would make then hidden or visible based on whether the checkbox (CheckHide) was checked or not. However, it's not working.

    Any advice? Am I completely off?

  2. #2
    Join Date
    Jun 2005
    Richmond, Virginia USA
    Provided Answers: 19
    You have it set up so that if CheckHide is ticked the controls will be visible. Is that really your intention? It sounds reversed, given the name CheckHide. One would think it should be if CheckHide is ticked, the controls should be hidden.

    Linq ;0)>
    Hope this helps!

    The problem with making anything that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Tags for this Thread

Posting Permissions

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