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
 

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

Back
Top