>Thanks Rick And Larry!!!
>
>From now since i know the problem, i decide to solve it hardcoding 'controls(1)'
>
>FOR i = 1 TO _SCREEN.CONTROLCOUNT
> _SCREEN.REMOVEOBJECT(_SCREEN.CONTROLS(i).NAME)
>ENDFOR
I think you mean
_SCREEN.REMOVEOBJECT(_SCREEN.CONTROLS(1).NAME)
IAC, you could also use the ControlCOunt property in the RemoveObject line. I saw this technique in a message by Ed Rauh last week:
With _Screen
for i = 1 TO .ControlCount
.RemoveObject(.Controls(.ControlCount).Name)
endfor
Endwith
The range for i is pre-initialized but ControlCount continually changes during the process. This will always remove the last object in the collection.
Larry Miller
MCSD
LWMiller3@verizon.netAccumulate learning by study, understand what you learn by questioning. -- Mingjiao