Setting Field Focus after Function Call

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
 
K

Klatuu

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

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