Results 1 to 3 of 3
  1. #1
    dinarocks74 is offline Novice
    Windows XP Access 2003
    Join Date
    Mar 2009
    Posts
    4

    making a check box disappear from a form when another box is selected

    I have a form that has a few check boxes. The problem I am having is how to make check box B, C, D etc.. disappear when I select Check box A? I can make the label's and Text box disappear when I select Check box A, however the Check box themselves wont disappear. See below for the code I have.

    Private Sub Check197_Click()
    If Me.Check197 = True Then


    Me.Text204.Visible = True
    Else
    Me.Text204.Visible = False
    End If
    Me.Text237.Visible = False
    Me.Check235 = False
    Me.Label236.Visible = False
    Me.Text233.Visible = False
    Me.Check193 = False
    Me.Label194.Visible = False
    If Me.Check197 = False Then
    Me.Text237.Visible = True
    Me.Check235 = True
    Me.Label236.Visible = True
    Me.Text233.Visible = True
    Me.Check193 = True
    Me.Label194.Visible = True
    Else
    End If
    If Me.Check197 = True Then
    Me.Check235.Locked = True
    Me.Check193.Locked = True
    Else
    End If
    If Me.Check197 = False Then
    Me.Check235.Locked = False
    Me.Check193.Locked = False
    End If
    End Sub

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    You will need to change the Visible property of the CheckBoxes if you want them to disappear.

  3. #3
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I can not tell from code you posted which CheckBoxes you want invisible.
    Code:
    Private Sub Check197_Click()
       If Me.Check197 = True Then
          Me.Text204.Visible = True
       Else
          Me.Text204.Visible = False
       End If
       Me.Text237.Visible = False
       Me.Check235 = False
       Me.Label236.Visible = False
       Me.Text233.Visible = False
       Me.Check193 = False
       Me.Label194.Visible = False
       If Me.Check197 = False Then
          Me.Text237.Visible = True
          Me.Check235 = True
          Me.Label236.Visible = True
          Me.Text233.Visible = True
          Me.Check193 = True
          Me.Label194.Visible = True
       Else
       End If
       If Me.Check197 = True Then
          Me.Check235.Locked = True
          Me.Check193.Locked = True
       Else
       End If
       If Me.Check197 = False Then
          Me.Check235.Locked = False
          Me.Check193.Locked = False
       End If
    End Sub

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 05-29-2014, 09:58 PM
  2. Making subforms editable
    By ashiers in forum Forms
    Replies: 7
    Last Post: 10-08-2008, 04:09 PM
  3. Making a new field in a query
    By mslieder in forum Queries
    Replies: 3
    Last Post: 05-14-2008, 11:44 AM
  4. Replies: 2
    Last Post: 11-17-2006, 01:07 PM
  5. Loading the form with selected record
    By emilylu3 in forum Access
    Replies: 1
    Last Post: 12-09-2005, 07:49 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums