Sections of form activated by a combo box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form where the bottom half of it is only relevant if the value of a
combo box above is "son" or "daughter." Is there any way I can set the
fields in the bottom half of the form to be either greyed-out or not appear
by default, and then activate when the value entered in the combo box above
is set to "son" or "daughter?"
 
Yes. Just put code in the form's CURRENT event. This will fire as you
scroll from one record to the next. Put the same code in the AFTER UPDATE or
ON EXIT event for that field you mentioned. This will cause those fields to
become visible or not visible if you change the field to son or daughter.


the code would be basically...




If [SomeField] = "Son" or [SomeField] = "daughter" then
Me.SomeOtherField.visible = true
Me.SomeFieldTwo.visible = true
Else
Me.SomeOtherField.visible = false
Me.SomeFieldTwo.visible = false
EndIf
 
That worked great, thank you SO much!! And thanks for the sample code... it
would have taken me quite a while to figure that one out on my own. Thanks
again!

Tim
 
Back
Top