Toggle button and subform

  • Thread starter Thread starter Raj
  • Start date Start date
R

Raj

Hello all,
I have a subform on my main for that I would like to use
a toggle button to make it visible and un-visible. Is
this possible if so how would I do it? I have no
experience with writing code..
Thank you..
 
Hello all,
I have a subform on my main for that I would like to use
a toggle button to make it visible and un-visible. Is
this possible if so how would I do it? I have no
experience with writing code..
Thank you..
A subform is a control on a form. It has a visible property that can
be manipulated ...
Say you had a toggle named tglSfrmVisible the code might look like...


Private Sub tglSfrmVisible_Click()
If Me.subformname.Visible = True Then
Me.subformname.Visible = False
Me.tglSfrmVisible.Caption = "Show Sub"
Else
Me.subformname.Visible = True
Me.tglSfrmVisible.Caption = "Hide Sub"
End If

End Sub

If you would replace "subformname" with your subform controls name
(not necessarily the name of the form it uses) then this would toggle
the visibility of the subform and change the caption of the toggle to
help the user understand its purpose.

- Jim
 
Jim,
It works great..
Thank very very much..
-----Original Message-----

A subform is a control on a form. It has a visible property that can
be manipulated ...
Say you had a toggle named tglSfrmVisible the code might look like...


Private Sub tglSfrmVisible_Click()
If Me.subformname.Visible = True Then
Me.subformname.Visible = False
Me.tglSfrmVisible.Caption = "Show Sub"
Else
Me.subformname.Visible = True
Me.tglSfrmVisible.Caption = "Hide Sub"
End If

End Sub

If you would replace "subformname" with your subform controls name
(not necessarily the name of the form it uses) then this would toggle
the visibility of the subform and change the caption of the toggle to
help the user understand its purpose.

- Jim
.
 
Back
Top