Evelyn,
>in the first search, mygrid1 highlights the found record. but after the second try, i get error "activeform is not an object".
Somewhere in the code you did not post you must have a reference to _screen.ActiveForm, and and on your second try there is no form currently active. In general you need to test that before you can use it:
if ( type( "_screen.ActiveForm" ) = "O" )
_screen.ActiveForm.SomeMethodCall()
endif