>>>Is there a way to force the focus to go to the next object in the KeyPress event of a textbox if TAB is pressed? nKeyPress = 9, but what do I do to make it jump to the next object on the form?
>>
>>You can use SetFocus and Nodefault, e.g.
>>
>>If nKeyCode=9
>> Thisform.Control1.Setfocus
>> Nodefault
>>Endif
>>
>
>How do I know what the next control is? If the textbox has a TabOrder of 13, how do I get it to setfocus to the control with a TabOrder of 14?
You can search controls for appropriate TabIndex property, though if you want to move to the next control in tab order then simple Tab key will do it just fine, i.e. no SetFocus required.
Edward Pikman
Independent Consultant