Voodoo_chile
asked on
What kind of functions should be put in Form_Current event?
What kind of functions should be put in Form_Current event? Where should I put functions such as assign recordsource for the subforms, and adjust subform size?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
"Anything you want to happen when the form "moves" to a new record."
Of course, the Form Current event also triggers when moving through and *existing* record.
"Usually, the recordsource for a subform is assigned in design mode. "
However, when a tab control say has a subform on each tab ... a common scenario, rather than have all recordsources populating when a form opens, generally a performance hit ... you populate a subform's recordsource 'on demand' when that tab is selected.
mx
Of course, the Form Current event also triggers when moving through and *existing* record.
"Usually, the recordsource for a subform is assigned in design mode. "
However, when a tab control say has a subform on each tab ... a common scenario, rather than have all recordsources populating when a form opens, generally a performance hit ... you populate a subform's recordsource 'on demand' when that tab is selected.
mx
mx,
You are correct on all counts. My language was sloppy. I meant "moves to a different record", not a "new" record.
You are correct on all counts. My language was sloppy. I meant "moves to a different record", not a "new" record.
no. Just trying to keep it straight :-)
mx
mx
Anything you want to happen when the form "moves" to a new record. For example, suppose you want to change the color of a field depending on the value it contains.
Where should I put functions such as assign recordsource for the subforms, and adjust subform size?
Usually, the recordsource for a subform is assigned in design mode. However, if your design filters the subform based on a field in the mainform, then it might make sense to change the recordsource in the form's current event.
I don't know when or why you might want to change the size of a subform.