Controlling Focus

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have unbound controls setup in the header of a form that are used for
limiting the records displayed in the main form. The after update event of
each unbound control requerys the main form. I have the tab order setup to
cycle through the controls in the header (works fine without the requery).
The problem is, when pressing <enter> (and thus requerying the form), the
focus goes to the first control on the main form rather than the next control
in the header.

Any ideas on how to stop this?

Thanks

Dave
 
David said:
I have unbound controls setup in the header of a form that are used for
limiting the records displayed in the main form. The after update event of
each unbound control requerys the main form. I have the tab order setup to
cycle through the controls in the header (works fine without the requery).
The problem is, when pressing <enter> (and thus requerying the form), the
focus goes to the first control on the main form rather than the next control
in the header.

Any ideas on how to stop this?

Thanks

Dave

There is probly a better way but I would use the On Enter event for each
control like this:

me.(ControltoFocusOn).setfocus


this will set the focus on the control you want when you hit the Enter key in
a field.
 
Sounds like you are requerying the form. This would be the expected
behaviour. Try requerying just the recordset.
 
Back
Top