I think a solution for this problem is to have a parameters sentence in the refreh() method of your form. If a .f. (false) parameter is passed you dont execute code.
The code in the commandbutton seems like
thisform.refresh(.f.).
The code in the refresh() method of your form seems like
lparameters true
if parameters() = 0 or true
...sentences
endif
¿is this a solution for you ?
Saludos,
A.G.P.
---------