How do I hide a label attached to a subform?

G

Guest

I have a bunch of subforms in a form and when no information is provided for
that subform, the subform disappears. However, the attached label for the
subform does not disappear. I can I make the label hide with the subform?

If that isn't feasible, is there anyway that I can have the blank datasheet
subform be visible even if there is no information provided for that subform?
For example, if I have a subform datasheet that lists grants and that
researcher has no grants, is there anyway I have just the blank datasheet
open?

Thanks in advance for your help.
 
A

Anthos

If you are doing this in VBA, you need to know the name of the label,
and the subform.

then set both their visible values to true or false at the same time

'// Start Code

Private Function HideSubform(bolVisible as Boolean)
Me.labelname.visible = bolVisible
Me.subformname.visible = bolVisible
End Function

'// End Code

With the code above inserted into your forms,
You can simply, in your code, call HideSubform(true) or
HideSubform(false) and it will hide both the subform and your label
with it.

Hope this helps.
 

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