Setting Field Focus after Function Call

  • Thread starter Thread starter Malcolm Hind
  • Start date Start date
M

Malcolm Hind

I have a Color picker to lookup color numbers to be kept in
fields - I give access to the Color Picker via a button, whn
the user has selected a button I would like to be able to
place him back in the field he came from (the one the color
was chosen for) or the next field in tab order (I have not
decided which is better yet) using code.

I have tried using Screen.PreviousControl.SetFocus but that
ends up with another window being selected - I presume because
I have been in the color picker window ?

I have experimented with saving the field name using
savFieldFocusName = Screen.PreviousControl - then trying to
set focus by using it - savFieldFocusName.SetFocus or
Screen.ActiveControl.Name = savFieldFocusName but these
generate an error about unsupported somethings.

Can someone give me a good way to do this please ?

Thanks
 
Wayne,
A form will not accept the focus if there are any controls on the form
capable of accepting the focus.
 
Back
Top