>Try the following
>
>lnNextControl = THIS.TabIndex+1
>IF THISFORM.ControlCount > lnNextControl
> THISFORM.CONTROLS(lnNextControl).SETFOCUS
>ENDIF
>
>You could also make it more sophisticated by checking to ensure that
>THISFORM.CONTROLS(lnNextControl).BASECALASS <> "LABEL" and also <>"CONTAINER" .. etc
Wouldn't work, because the form.controls[] array lists controls in design order, not the tabindex order; so, this will set focus to the control which was next added to the form at design time, and probably not to the next one in tabindex order. Parsing the .controls[] array for the first control with a greater tabindex is also not good, because some of the controls which were first added, may have been moved to be far later in the tabindex.
If this array is to be used, we should look for the control with the tabindex equal to current plus one.