Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I have a subform which I want to be

Status
Not open for further replies.

zrobinso

MIS
Apr 22, 2001
27
0
0
US
I have a subform which I want to become visible if a check box field is checked. I am using the following Event procedure on the check box. It works if you open the main form to add new records. How can I keep the subform not visible when not checked if you are scrolling through records from check to not checked??


Private Sub Option94_Click()

If Me.Option94 Then
Me.frm_SubfrmEmpInfo.Visible = True
Else
Me.frm_SubfrmEmpInfo.Visible = False
End If

End Sub

Thanks for Any help.

Z
 
if you put this code in the main forms on_current property that should fix change the subform when needed.

hope that helps
[peace]
 
Thanks joshkay. This does the job perfectly.
 
I'm assuming that Option94 is a control on the form from which you are scrolling records. If so try this...

Private Sub Form_Current()
If Me.Option94 Then
Me.frm_SubfrmEmpInfo.Visible = True
Else
Me.frm_SubfrmEmpInfo.Visible = False
End if
End Sub

You can streamline this even more by setting the subForm.visible to False and the just turning it on when Option94 is true..... Stu

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top