Enabling and disabling a subform

C

Chris Strug

Hi,

Probably a bit obvious, but how can I enable / disable a subform in vba?

For example, I want to disable the subform on loading the main form and
enable after the afterinsert event...

Thanks

Chris Strug
 
K

Ken Snell

Me.Subform.Enabled = False

where Subform is the name of the subform control (the one that holds the
subform) on the main form.
 
V

Van T. Dinh

As a sidebar to your question, I prefer to hide / show the
Subform rather than enable / disable for data entry.
Basically, I have a CommandButton for the user to actually
saves the One/Parent Record on the main Form and this
CommandButton also make the Subform visible. This way,
you force the user to explicitly save the One/Parent
Record before they can enter the Many/Child Records and
prevent the problem with the AutoSave feature of the
linked Form/Subform combination.

HTH
Van T. Dinh
MVP (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