fForms

  • Thread starter Thread starter pat
  • Start date Start date
P

pat

How do i make a subform only visible when the contents of
a field on the main form has a valid entry (ie is not
blank).

I do not wish the sub form to be visible at any other
time.


pat
 
Pat,

Assuming your subform is called MySubForm, and the control on the main
form is called MyControl, you need to put the following lines of code:

vShow = Not (Me.MyControl = "" Or IsNull(Me.MyControl))
Me.MySubForm.Visible = vShow

in the following two events:
1. The form's On Current event (so it shows / hides the subform as you
browse through records)
2. The control's After Update event (so it does the same when you change
the contents of the control).

Just change the names in the code to the actual ones.

HTH,
Nikos
 
Back
Top