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?
>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.
Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.
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.