if !this.freetable do case case inlist(lastkey(),24,5,18,3,145) ; and !empty(dbgetprop(this.recordsource,"Table","RuleExpression")) ; and !evaluate(dbgetprop(this.recordsource,"Table","RuleExpression")) nodefault case lastkey() = 27 ; and !empty(dbgetprop(this.recordsource,"Table","RuleExpression")) ; and !evaluate(dbgetprop(this.recordsource,"Table","RuleExpression")) =tablerevert(.f.) endcase endifSince I just cut&paste you should play with it some (ie: contains a custom prop ref to freetable). In init related database is opened if not (-if not free-)and freetable is set. It's bypassed with mouse clicks of course. It's an old code and not revised yet. You can extend it for your needs. BTW: it's in beforerowcolchange.