Toggle Button for Visible Command

  • Thread starter Thread starter Ben
  • Start date Start date
B

Ben

I have a form that has several fields hidden (Not Visible). I want to be
able to click a toggle button and make those fields visible, then when I am
done entering data, click the button again and those fields hide.

My fields are:
Phase1
Phase1Status
Deliverable1
Deliverable1Status

All those fields are Visible = No. So, when I click the toggle button once
those fields should be Visible=Yes, then enter data, then click the toggle
button again and those fields hide.

Thanks
 
I have a form that has several fields hidden (Not Visible). I want to be
able to click a toggle button and make those fields visible, then when I am
done entering data, click the button again and those fields hide.

My fields are:
Phase1
Phase1Status
Deliverable1
Deliverable1Status

All those fields are Visible = No. So, when I click the toggle button once
those fields should be Visible=Yes, then enter data, then click the toggle
button again and those fields hide.

Thanks

You can use a Toggle Button, but a Command Button works just as well.
I take it there are additional controls on the form that will always
remain visible, and it is just these 4 controls you wish to toggle.
If so, in each of those 4 control's Tag property write:
ToggleMe


As the controls are originally not visible, set the Command Button
caption to "Show"

Then code the command button's click event:
If Me.CommandButtonName.Caption = "Show" Then
Me.CommandButtonName.Caption = "Hide"
Else
Me.CommandButtonName.Caption = "Show"
End If
Dim ctl as Control
For each ctl in Me.Controls
If ctl.Tag = "ToggleMe" then
ctl.Visible = Not ctl.Visible
End If
Next

Click the button will togglw the 4 controls Visible property and
change the caption accordingly.
 
Back
Top