Enabling and disabling a subform

  • Thread starter Thread starter Chris Strug
  • Start date Start date
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
 
Me.Subform.Enabled = False

where Subform is the name of the subform control (the one that holds the
subform) on the main form.
 
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)
 
Back
Top