>>>I had created a class method which setfocus to the
>>>first control of a form. But this method will give
>>>error if called within the 'valid' event.
>>>
>>>So how do i check whether the calling
>>>event is a control's 'VALID' event?
>>>
>>>thanks.
>>
>>You can't set focus from the valid event. As Bruce said, use the lostfocus.
>
>Actually, i am creating a generic class method but
>user may use it in the valid event
>=> I need to check for valid event in my class so that
>if in valid event
> do not do the setfocus()
>endif
>
>but my question is how in the code can i check that it is calling
>from valid event?
You could pass a parameter. Another option, although I haven't tried it, is to traverse the program call chain using the PROGRAM() function.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer