Results 1 to 2 of 2
  1. #1
    4 Star Lounger
    Join Date
    Mar 2005
    Location
    Leicestershire, United Kingdom
    Posts
    506
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Toggle button (2000)

    Is it possible to have a toggle button (tick box) on a form that when it opens if it's true a group of fields are visible, if it's false / null then the group of fields are invisible
    Best Regards,

    Luke

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

    Re: Toggle button (2000)

    Yes. You could use code like this:

    Private Sub tglButton_Click()
    Me.ControlA.Visible = Me.tglButton
    Me.ControlB.Visible = Me.tglButton
    Me.ControlC.Visible = Me.tglButton
    End Sub

    where tglButton is the name of the toggle button and ControlA etc. are the names of the controls you want to show/hide.
    Make sure to set the Default Value property of the toggle button to True or False, as desired.
    Add code to set the visibility when the form opens:

    Private Sub Form_Load()
    tglButton_Click
    End Sub

Posting Permissions

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