subform labels not losing focus

  • Thread starter Thread starter hje
  • Start date Start date
H

hje

I have a form with two subforms in addition to regular
fields. All fields have been set to have gotfocus and
lostfocus label color changes to display what field a user
is on. I did this also for the subforms.

Things look great, except when I Ctrl+Tab out of a subform
to continue to the next field. The field that I was last
on in that subform does not lose focus and change to the
original color. In fact, the only time it will change
back to the lostfocus color is when I tab far enough to
get a new record.

Any suggestions?
 
You could try and capture the Form_LostFocus event and just reset all the
labels. (I've never tried it so I don't know how reliable it is)

Eric Dreksler
 
Eric,

I gave your suggestion a try and it still leaves the
subform label with the "gotfocus" color. It's as if when
you hit Ctrl+tab it loses all reference to the subform and
leaves it in the current state.

Is there someway to reference a subform's label in a main
form? I was trying to figure a way to use the OnExit
event for the subform.
 
Actually, that probably is a better solution.

Take the repaint code you used (based on my earlier suggestion) and put it
in a sub or function.
Use the parent's Form_OnFocus() event to call the
YourSubFormName.Form.YourRepaintSub().

You can call any subforms from the parent form, just remember you have to
reference the YourSubFormName.Form.xxxxx (because your actually referencing
the child object attached to the form with the YourSubFormName)

Hope this works for you,
Eric Dreksler
 
Back
Top