tian,
I'm glad to help, but we really need you to answer the other questions I asked.
1) What line of code is giving you that error?
2) Is DOSOMETHING() a user defined function? Is it supposed to be a method of the form? If so you'd use _screen.Forms[i].DoSomething().
>sorry for not explaining in enough detail.
>and oh.. i am using visual foxpro 5.0