Highlight focus and required fields

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
 
M

Marshall Barton

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)
 
G

george 16-17

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)
 
M

Marshall Barton

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)
 
G

george 16-17

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)
 

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