local oObj oObj = .activecontrol if vartype(m.oObj) == "O" and PEMSTATUS(m.oObj,"DoValid",5) m.oObj.DoValid = .f. && Don't want to fire validation endif *!* && If it's a grid, we need to calculate the active control *!* 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 *!* && Check if control has different value than its ControlSource *!* if !(m.oObj.value==evaluate(m.oObj.controlsource)) *!* **oObj.setfocus && This is enough to write changes into ControlSource *!* m.oObj.value = m.oObj.value && Updated:NN: 06/07/02 *!* endif *!* endif .cmdProceed.SetFocus() && Updated:NN: 06/07/02>Hi - i am wanting to assign function keys to various code in my form class so that F1 moves to first record F2 to the previous record etc
>case nKeyCode == -5 && f6 save >.mSaveChanges() >>The problem is this - if I make changes to text in a textbox and leave the cursor in that textbox then press F6 I loose my changes even though my save routine is getting called - I always seem to loose the changes made to the textbox last edited (the one that the cursor is in when I press F6) - but if I use my save button on the form the changes are saved ok - i have "set confirm on" so I think the problem is that the textbox is not losing focus and the valid not getting called etc. I am not sure how to get it working correctly. Any ideas appreciated!