>I'm using a toolbar with active form to navigate through records and Add/Edit/Del Recs...
>
>The problem is when I go into edit/add mode and click on save/cancel button, the active control of form is still having focus and value is not refreshed..
>
>Active control can be any i.e textbox, combo, grid, check etc.etc.
>
>Is there a generic routine avl. for this problem ??
>
>Pls help...
Hello Vinod,
This is a standard behaviour of vfp. (and standard soulution too <g>)
That is a method called WriteBuffer() in your form or base class.
local llRetval
*--select your initialselectedalias here
if type("thisForm.ActiveControl")="O"
local loControl
loControl = thisForm.ActiveControl
if pemstatus(loControl,'SetFocus',5)
loControl.SetFocus()
endif
if lower(loControl.BaseClass) == "grid"
local lnColumn, loGrid, j, lcControlName
loGrid = loControl
lcControlName = loGrid.Columns[loGrid.ActiveColumn].CurrentControl
loControl = loGrid.Columns[loGrid.ActiveColumn].&lcControlName.
if pemstatus(loControl,'ControlSource',5)
loControl.SetFocus()
endif
endif
endif
return .t.
Bye,
Kaumir
Avani Cimcon ,Ahmedabad,India.