Issues with the click event

J

Jess

Hi!

I have a subform in a form. Both the subform and the form have multiple
textboxes and comboboxes with white backcolor –original backcolor.

I would like to make data entry easier by setting to blue the backcolor for
the control clicked by the user. When the user clicks on another control, the
original backcolor for the previously clicked control –white- is restored. In
other words, the blue backcolor “follows around†the clicked control.

I have encountered a major issue implementing the above. If a user clicks on
the record number for the navigation bar after having clicked on a control,
the control does not lost the focus –this event is not triggered. There does
not seem to be an event the traps a click in the record number for the
navigation bar. I have to wait for the user to click on another control in
the same form to restore the color –white- of the previuosly clicked control
-my code keeps track of the last clicked control. The same thing happens if
the user clicks on another application after having clicked on a control. The
control does not lose the focus.

How can I know if my users are clicking on another application or on the
record number for the navigation bar? Or how can I get the blue backcolor to
follow around the clicked control accounting the aforementioned issue?

Thanks for your help.
 
L

Linq Adams via AccessMonster.com

When you move from one record to another, focus stays on the same control;
that's normal behavior for Access. Why would you not want he control with
focus to be formatted? Isn't that the whole idea, showing the user which
field currently has focus?

Having said that, when you click on the navigation buttons to change records,
the Form_Current event fires, and I suppose you could place code here to
handle it.

When moving off of one form to another, within Access, the Form_Deactivate
event fires, but I don't believe it fires when moving to another application.
 
M

Marshall Barton

Jess said:
I have a subform in a form. Both the subform and the form have multiple
textboxes and comboboxes with white backcolor –original backcolor.

I would like to make data entry easier by setting to blue the backcolor for
the control clicked by the user. When the user clicks on another control, the
original backcolor for the previously clicked control –white- is restored. In
other words, the blue backcolor “follows around” the clicked control.

I have encountered a major issue implementing the above. If a user clicks on
the record number for the navigation bar after having clicked on a control,
the control does not lost the focus –this event is not triggered. There does
not seem to be an event the traps a click in the record number for the
navigation bar. I have to wait for the user to click on another control in
the same form to restore the color –white- of the previuosly clicked control
-my code keeps track of the last clicked control. The same thing happens if
the user clicks on another application after having clicked on a control. The
control does not lose the focus.

How can I know if my users are clicking on another application or on the
record number for the navigation bar? Or how can I get the blue backcolor to
follow around the clicked control accounting the aforementioned issue?


Since A2K, you can use Conditional Formatting (Format menu)
to highlight a form's control with the focus. If that
doesn't do what you want, then I think that's just the way
things work. The focus can move around in windows outside
you form (including the nav box, scroll bars, etc) without
affecting the active control in any open form.
 
J

Jack Leach

Maybe you can try using the OnExit event of the control to set the color back
to white? I don't know if this triggers on a change of applications, but it
should trigger anywhere else inside access

hth
--
Jack Leach
www.tristatemachine.com

"I haven't failed, I've found ten thousand ways that don't work."
-Thomas Edison (1847-1931)
 

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