>Hi Nick
>
>Sorry too many questions, but is the first time i doing this, i try your code like bellow, and
>
>create sql view myView1 as select forart.c_codigo,forart.c_sartigo,fornecedores.c_descri ;
>from forart ;
>left outer join fornecedores ;
>on fornecedores.c_codigo=forart.c_codigo;
>where forart.c_artigo=thisform.text1.value
You do this just once to create a view in your database. This should not be a part of your form controls code.
Then you
USE myView1
SELECT myView1
Or you put myView1 in your Dataenvironment. Since it has the parameters which may not be available when the view opens the first time you may set
NoDataOnLoad = .t. for this cursor. I would recommend you also to use variables for your view parameters, not directly thisform.text1.value. You need just make sure that the variable is available whn you REQUERY your view and that it contains proper value.
Nick
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro
"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison