PROCEDURE BeforeRowColChange LPARAMETERS nColIndex llChangingRow = .f. WITH this IF lastkey() = 145 && Adding new rec .nLastValidRec = .nCurrec ENDIF thisform.LockScreen = .lInGrid IF mdown() lnBottom = .top+.headerheight+.relativerow * .rowheight lnTop = lnBottom - this.rowheight lnMouseRowPos = mrow(wontop(),3) lnMouseColPos = mcol(wontop(),3) llChangingRow = !(between(lnMouseRowPos,lnTop, lnBottom) ; and between(lnMouseColPos,.left,.left+.width)) ELSE llChangingRow = inlist(lastkey(),24,5,18,3,145,148) ENDIF IF llChangingRow IF !empty(.columns(nColIndex).dynamiccurrentcontrol) cCurrentControl = eval(.columns(nColIndex).dynamiccurrentcontrol) ELSE cCurrentControl = .columns(nColIndex).currentcontrol ENDIF WITH evaluate(".columns(nColIndex)."+cCurrentControl) .value = .value && So we can evaluate table ruleexpression ENDWITH IF !empty(dbgetprop(.recordsource,"Table","RuleExpression")) ; and !evaluate(dbgetprop(.recordsource,"Table","RuleExpression")) thisform.LockScreen = .F. WAIT window nowait .cWarning NODEFAULT ENDIF ENDIF ENDWITH ENDPROC PROCEDURE Valid WITH this IF !empty(.columns(.nActiveColumn).dynamiccurrentcontrol) cCurrentControl = eval(.columns(.nActiveColumn).dynamiccurrentcontrol) ELSE cCurrentControl = .columns(.nActiveColumn).currentcontrol ENDIF WITH evaluate(".columns(.nActiveColumn)."+cCurrentControl) .value = .value && So we can evaluate table ruleexpression ENDWITH .refresh IF !.freetable ; and !empty(dbgetprop(.recordsource,"Table","RuleExpression")) ; and !evaluate(dbgetprop(.recordsource,"Table","RuleExpression")) IF messagebox(.cRevertMessage,4+16,"") = 6 TABLEREVERT(.f.,.recordsource) ELSE RETURN .f. ENDIF ENDIF .lInGrid = .f. IF .lTableupdate TABLEUPDATE(2,.t.,.recordsource) ENDIF IF eof(.recordsource) and .nLastValidRec # 0 lcRecSource = .recordsource .recordsource = "" GO .nLastValidRec in (lcRecSource) .recordsource = lcRecSource .RestoreControlSource() .recchange() ENDIF SELECT (.lcOldAlias) ENDWITH ENDPROCCetin