>HI,
>I've put this in my click() method of my base class toolbar button :
>
>_Screen.ActiveForm.ActiveControl.Setfocus()
>
>To make sure that if a control has the focus when I issue TABLEUPDATE(), the toolbar button will act Like a command button on the form, it will save all fileds even the one of the textbox that have the focus on. But when the activecontrol is a grid, I get the error message :
>
>ACTIVECONTROL is not an object.
>
>Is there a way to execute the code for all controls but not for a grid ? I tried:
>IF _Screen.ActiveForm.ActiveControl.Baseclass <> "GRID" but I get the same error message.
>
>Thank you for your help,
>
Christian,
You may put this condition, so you wouldn't have an error:
if type('_screen.ActiveForm.ActiveControl')="O"
_screen.ActiveForm.ActiveControl.SetFocus()
endif
If it's not broken, fix it until it is.
My Blog