Chuck,
Do you mean button doesn't work or textbox doesn't work? Try to restart VFP session (it should not make any difference, but just in case :)).
If you put the same code, I belive, it should work. Check KeyPreview property for the form too.
>I did the following. I cut/paste the whole ClickEvent into MyFind (the referances are same and fine). I think it is working OK. Yet, when I open the form for first time (even second, third, fourth time, but first try after opening the form), it does not do the Find correctly, but after I try again (while the form is opened), it works... I don't understand, shouldn't make any different?? BTW, I rem out the NoDeFault because I want to do it over and over again, correct?
>
>Chuck
>
>>Add a method to your form, say, MyFind(). Put all your code, which you currently have in Command1.Click into this new method (update references to the objects, if needed).
>>
>>Now, in the Command1.Click just put thisform.MyFind() and the same in KeyPress:
>>
if nKeyCode=13
>> thisform.MyFind()
>> nodefault
>>endif
If it's not broken, fix it until it is.
My Blog