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?
Microsoft Access

Avatar of undefined
Last Comment
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
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

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of dqmq
dqmq
Flag of United States of America image

>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
Avatar of dqmq
dqmq
Flag of United States of America image

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
Microsoft Access
Microsoft Access

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.

226K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo