subform labels not losing focus

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?
 
E

Eric Dreksler

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
 
H

hje

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.
 
E

Eric Dreksler

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top