Remove a sub form from main form if sub form has blank fields

W

Wayne Viles

I have several sub forms installed in my main form but there a few sub forms
which have blank fields. Is it possible for the main form not to show any
empty sub forms when viewed.
 
A

Arvin Meyer [MVP]

Wayne Viles said:
I have several sub forms installed in my main form but there a few sub forms
which have blank fields. Is it possible for the main form not to show any
empty sub forms when viewed.

You can show or hide a subform:

Me.NameOfSubformControl.Visible = True ' or False

based upon the results of a recordcount. You can also change its height on
the same basis. Forms do not have a CanShrink or CanGrow property like
printed reports, so I might ask if you have thought about what you will do
with the blank space when the subform isn't visible?
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access
 

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

Top