0
votes

I have customized ribbons for each parent form. I need to set subform ribbon to be same with parent form.

I initiate ribbon on each forms and subforms on "Form_Load" routine. Parent form ribbon will be different for different user. I cannot hard code it on form property. On subform, I use Me.Parent.Form.RibbonName to get parent form ribbon name.

Me.Parent.Form.RibbonName is able to return parent form name. But, Subform "Form_Load" is trigged before parent form "Form_Load" is trigged. Me.Parent.Form.RibbonName will return null value.

Will it possible to control the load sequence between parent form and subforms? Parent form need to be loaded before any subforms are loaded.

Thanks.

2
You can't alter mother nature :) Since you know the sequence of events, can't you just put code in the parent form's Load event to change the subform ribbon?Wayne G. Dunn

2 Answers

1
votes

The sequence is three-fold:

  1. Subform loads
  2. Main form loads
  3. Subrom loads

So have code in the subform that disables any code when opened initially. Set a flag. When opened next time, run your code and/or sets your variables.

0
votes

Yes you can. Set the Subforms holders control source to "" Then in the on load or at some other event of the parent form set the subform control to your subform.

 Me.subFormHolder.SourceObject = "subfrmYourSubformName"