Toggle button and subform

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..
 
J

Jim Allensworth

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
 
R

Raj

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
.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top