Re: Setfocus jumps to next field, but default value is selected in that field.
AA Arens wrote in message
<1140268810.203914.3940@g43g2000cwa.googlegroups.c om> :[color=blue]
> Hi Jeff,
>
> It works. I use SetFocus as most of the field as list boxes and after
> selecting the right value it jumps to the next value which it does not
> with only TAB or when there is no List Box. I already set the right TAB
> order.
> Regarding that, when there is no list box, I use to use TAB. How to
> have the cursor also jumped to the right?
> I guess I need to choose the KeyPress part.
>
> Bart[/color]
The lazy way, could be to enter Tools | Options - in the Keyboard tab,
then akter the "Behavior entering field" property (Go to end of field).
This can be manipulated programatically too, if you like (some typed
not tested sample)
' declaration section
private lngProp as long
' in a sub...
lngProp = application.getoption("behavior entering field")
if lngProp <> 2 then
application.setoption "behavior entering field", 2
end if
' then afterwards (form close/unload?) reset
BTW - if you intend to try to trap through some of the key events, try
the KeyDown. I dont think the KeyPress will catch keys that will cause
the focus to change ...
--
Roy-Vidar |