That's simple - because your last active control would be the button in this case, which doesn't have a value property :) You have to check if value orioerty exists by using Pemstatus() function. You also had to assign LastActiveControl in command button When event. This way it would work properly. Sorry, for not telling all of these from the beginning :)
>Sorry, i forgot to add the property, but it give this error
>
>>if type('thisform.LastActiveControl')="O"
>>wait window thisform.LastActiveControl.value --->Property value is not found
>>endif
>
>In the search button
>
>
with thisform
> .LastActiveControl=.ActiveControl
> do form search_listbox
> if type('thisform.LastActiveControl')="O"
>wait window thisform.LastActiveControl.value
>* thisform.LastActiveControl.Value=c_Codigo
> * thisform.LastActiveControl.SetFocus()
> else
> =messagebox("Sorry, Pal. Try again...", 48, "Nice try")
> endif
>endwith
>
>
>
>João Batista
If it's not broken, fix it until it is.
My Blog