&& áåðåì àêòèâíûé êîíòðîë oObj = thisform.ActiveControl if vartype(m.oObj) == "O" AND PEMSTATUS(m.oObj,"value",5) && ïðîâåðÿåì ãðèä ëè îí, åñëè äà, èùåì òåêóùèé àêòèâíûé êîíòðîë if upper(m.oObj.BaseClass) == "GRID" nIndex = m.oObj.ActiveColumn for i=1 to m.oObj.ColumnCount if m.oObj.Columns(i).COlumnOrder = nIndex nIndex = i exit endif endfor oObj = m.oObj.Columns(nIndex) oObj = evaluate("m.oObj." + m.oObj.CurrentControl) endif && ïðîâåðÿåì ìåíÿëñÿ ëè êîíòðîë ïî ñðàâíåíèþ ñî çíà÷åíèåì ControlSource if !(m.oObj.value==evaluate(m.oObj.ControlSource)) m.oObj.SetFocus && ýòîãî äîñòàòî÷íî ÷òîáû çàïèñàòü èçìåíåíèÿ â ControlSource end if end ifThis is just a sample. To make it generic, you have to add checking for ActiveX controls, OLEBoundControl (you cannot compare field of General type) etc. I also did not tested the code - it was just a sample I took from my head. I used this approach many times to assure active control saved its value before firing the Valid event of the control.
>if type('thisform.ActiveControl.value')<>'U' && Active control exists and has a value property > thisform.ActiveControl.value = thisform.ActiveControl.value > endif>