Sub Forms

F

feeman

I have a main form with a field for age it also has 2 sub forms on it
1 sub form always needs to be displayed no matter what, but the other
one is dependant on age. If the age is greater than 25 subform 2 does
not appear, if the age is below 25 subform 2 appear. How can I did
this. speak clearly as still learning to use access.
 
K

Ken Snell \(MVP\)

Use the main form's Current event to test the age value, and then set the
Visibility of that second subform control based on the test result.
 
F

feeman

Use the main form's Current event to test the age value, and then set the
Visibility of that second subform control based on the test result.

--

Ken Snell
<MS ACCESS MVP>






- Show quoted text -

how is this done, i understand the current event bit, what would the
code look like. also how do you set the visibility of the second form
please.
 
K

Ken Snell \(MVP\)

Example code:

Private Sub Form_Current()
Me.NameOfSecondSubformControl.Visibility = (Me.AgeFieldName.Value<=25)
End Sub


--

Ken Snell
<MS ACCESS MVP>
 

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

Similar Threads


Top