Highlight focus and required fields

  • Thread starter Thread starter george 16-17
  • Start date Start date
G

george 16-17

Greetings all,

I recently installed Allen Browne's "Highlight the required fields, or the
control that has focus" module. It works great and has improved the
functionality of my forms.

The only question I have, is how to use it with a subform. I did set the
OnLoad property of the subform to "=SetUpForm([Form])". It does highlight the
control that has focus, but when the subform loses focus, the last control
remains highlighted and does not reset to its "usual back color". I must be
doing something wrong.

Any thoughts? Thanks in advance,
george
 
george said:
I recently installed Allen Browne's "Highlight the required fields, or the
control that has focus" module. It works great and has improved the
functionality of my forms.

The only question I have, is how to use it with a subform. I did set the
OnLoad property of the subform to "=SetUpForm([Form])". It does highlight the
control that has focus, but when the subform loses focus, the last control
remains highlighted and does not reset to its "usual back color". I must be
doing something wrong.


You are not doing anything wrong. The main form and each
subform has its own active (focus) control so what you are
seeing is expected.

To reset the highlighted control in a subform, I think you
would need to add some logic to the Hilight procedure to
remember which control is hilighted. Then you could use the
subform control's Exit event to reset the subform's active
control's color. (I haven't used Allen's code for this so I
can't provide the exact code)
 
Hi Marshall,

Thanks for the advice...much appreciated. I will try to add the logic per
your suggestion. I will post back if I have any difficulties.

george

Marshall Barton said:
george said:
I recently installed Allen Browne's "Highlight the required fields, or the
control that has focus" module. It works great and has improved the
functionality of my forms.

The only question I have, is how to use it with a subform. I did set the
OnLoad property of the subform to "=SetUpForm([Form])". It does highlight the
control that has focus, but when the subform loses focus, the last control
remains highlighted and does not reset to its "usual back color". I must be
doing something wrong.


You are not doing anything wrong. The main form and each
subform has its own active (focus) control so what you are
seeing is expected.

To reset the highlighted control in a subform, I think you
would need to add some logic to the Hilight procedure to
remember which control is hilighted. Then you could use the
subform control's Exit event to reset the subform's active
control's color. (I haven't used Allen's code for this so I
can't provide the exact code)
 
On further reflection, maybe it's not that complicated. Try
just using a line of code in the subform's Exit event:

Me.subformcontrol.Form.ActiveControl.BackColor = vbWhite

ot whatever color you have for control's without the focus.
--
Marsh
MVP [MS Access]

Thanks for the advice...much appreciated. I will try to add the logic per
your suggestion. I will post back if I have any difficulties.


Marshall Barton said:
george said:
I recently installed Allen Browne's "Highlight the required fields, or the
control that has focus" module. It works great and has improved the
functionality of my forms.

The only question I have, is how to use it with a subform. I did set the
OnLoad property of the subform to "=SetUpForm([Form])". It does highlight the
control that has focus, but when the subform loses focus, the last control
remains highlighted and does not reset to its "usual back color". I must be
doing something wrong.


You are not doing anything wrong. The main form and each
subform has its own active (focus) control so what you are
seeing is expected.

To reset the highlighted control in a subform, I think you
would need to add some logic to the Hilight procedure to
remember which control is hilighted. Then you could use the
subform control's Exit event to reset the subform's active
control's color. (I haven't used Allen's code for this so I
can't provide the exact code)
 
Hi Marshall,

Worked like a charm...Thanks! That line of code reset the subform control's
back color upon exiting.

george

Marshall Barton said:
On further reflection, maybe it's not that complicated. Try
just using a line of code in the subform's Exit event:

Me.subformcontrol.Form.ActiveControl.BackColor = vbWhite

ot whatever color you have for control's without the focus.
--
Marsh
MVP [MS Access]

Thanks for the advice...much appreciated. I will try to add the logic per
your suggestion. I will post back if I have any difficulties.


Marshall Barton said:
george 16-17 wrote:
I recently installed Allen Browne's "Highlight the required fields, or the
control that has focus" module. It works great and has improved the
functionality of my forms.

The only question I have, is how to use it with a subform. I did set the
OnLoad property of the subform to "=SetUpForm([Form])". It does highlight the
control that has focus, but when the subform loses focus, the last control
remains highlighted and does not reset to its "usual back color". I must be
doing something wrong.


You are not doing anything wrong. The main form and each
subform has its own active (focus) control so what you are
seeing is expected.

To reset the highlighted control in a subform, I think you
would need to add some logic to the Hilight procedure to
remember which control is hilighted. Then you could use the
subform control's Exit event to reset the subform's active
control's color. (I haven't used Allen's code for this so I
can't provide the exact code)
 
Back
Top