*container credit * Custom properties * cFlag - Holds table.fieldname of flag * Controlsource - Holds table.fieldname of creditdebit * Custom method : * movefocus() - Moves focus off column *container credit.init With this .ChkFlag.ControlSource = .cFlag .txtCredit.Controlsource = .ControlSource .txtDebit.Value = 0 Endwith *container credit.movefocus With this.parent lnThisPos = .columnorder With .Parent lnNextOrder = iif(lnThisPos = .ColumnCount, 1, lnThisPos + 1) lnPrevOrder = iif(lnThisPos = 1, .ColumnCount, lnThisPos - 1) For ix = 1 to .ColumnCount If .Columns(ix).ColumnOrder = ; iif(inlist(lastkey(), 15, 19), lnPrevOrder, lnNextOrder) .Columns(ix).SetFocus() Exit Endif Endfor Endwith Endwith * txtDebit.Lostfocus With this.parent If this.Value # 0 .txtCredit.Value = this.Value .ChkFlag.Value = .F. This.Value = 0 .MoveFocus() Endif Endwith * txtCredit.Lostfocus With this.parent If this.Value # 0 .ChkFlag.Value = .T. .txtDebit.Value = 0 .MoveFocus() Endif Endwith * container debit.init && Subclassed from container credit With this .ChkFlag.ControlSource = .cFlag .txtDebit.Controlsource = .ControlSource .txtCredit.Value = 0 Endwith *txtCredit.Lostfocus With this.parent If this.Value # 0 .txtDebit.Value = this.Value .ChkFlag.Value = .T. This.Value = 0 .MoveFocus() Endif Endwith *txtDebit.Lostfocus With this.parent If this.Value # 0 .ChkFlag.Value = .F. .txtCredit.Value = 0 .MoveFocus() Endif Endwith * Grid.Column.Dynamiccurrentcontrol : * iif(mytable.myflag, "ContainerCredit", "ContainerDebit")Cetin