>Who can help me?
>I have a grid (recordsource is cursor 'income1').
>On the right column I added the following lines in the 'keypress' event:
LPARAMETERS nKeyCode, nShiftAltCtrl
>if nkeycode=24
>select income1
> append blank
>This.Parent.Parent.Column1.combo1.setfocus
>endif
>I want the user will get the focus of the next line by pressing on the arrowdown key (number 46), every thing is good, but the user getting the focus on the right column, how can I give him focus on the left column?
>(As you can see I used with set fucus, but it's not working).
>
>Thanks in advance
Chaim,
This may help
LPARAMETERS nKeyCode, nShiftAltCtrl
if nkeycode=24
NODEFAULT
select income1
append blank
=this.YourGridName.Refresh()
=this.YourGridName.FirstEnabledColumn_SetFocus()
endif
local FirstCol
FirstCol = this.GetFirstEnabledColumn()
do case
case isnull(FirstCol)
=this.SetFocus()
otherwise
=this.SetFocus()
=FirstCol.SetFocus()
endcase
local _col, mincol, mincolorder, i
mincol = Null
for i = 1 to this.ColumnCount
_col = this.Columns[i]
if( !_col.ReadOnly and _col.Enabled and _col.Visible )
if( IsNull(mincol) )
mincol = _col
mincolorder = _col.ColumnOrder
else
if( _col.ColumnOrder < MinColOrder )
Mincol = _col
Mincolorder = _col.ColumnOrder
endif
endif
endif
endfor
return MinCol
Gregory