Link to home
Start Free TrialLog in
Avatar of Voodoo_chile
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
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
>What kind of functions should be put in Form_Current event?

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.
"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
mx,
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