Focus

belsha

Registered User.
Local time
Today, 06:38
Joined
Jul 5, 2002
Messages
115
Could someone tell me how to set the focus for this scenario?
Main form is frmMainRevised
Subform 1 is subfrmVitalsRev
Subform 2 is LabEmotRev (with the field CBC I want to go to from exit on subfrmVitalsRev.

Where to put the code, and what references to use, I've tried everything I can think of!
 
the on exit (or something) event use something like (sorry for the Psuedo Code...)

Me.parent.form.subform.control.setfocus

Or something alike, cause you cannot reference your second subfrom directly from the first. You first have to go 'up' to your main form....

Regards
 
On the OnExit event of subfrmVitalsRev I used

Me.frmMainRevised.subfrmLabEmotRev.CBC.SetFocus.

I keep getting sent back to the first field in the subfrmVitalsRev.
Note: I do have the cycle property on that subform set to current record and don't want to have to change that.

Any ideas?
 
You can't use the Exit event of the subform, unless you click on the main form or somewhere that takes the focus off the subform the Exit event will not fire
 
OK, how can I send focus from that subform to the field on the other subform then?
 
Use the Lost Focus Event of the last control on the subform, assuming users are only entering single records
 

Users who are viewing this thread

Back
Top Bottom