Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Select after choose 2 fields
Message
 
To
12/03/2000 19:15:46
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00344762
Message ID:
00344791
Views:
26
>Hi Nick
>
>My Tables are
>
>Itens
>------
>Ref.ID
>Description
>Key = Ref.ID
>
>Supliers
>------------
>Suplier.ID
>Ref.ID
>Key=Suplier.ID+Ref.ID
>
>In my form when i input Ref.ID and Suplier.ID i want to create a view with Ref.ID from the Supliers Table and Description from my table Itens.
>
>What i want is to create a view with all items that the suplier have with the itens(tb) Description.
>
>Thank's
>
>Joao

If I understand you right, you input Ref.ID and Suplier.ID into textboxes.

Try:

SELECT supliers.suplier_id, suplier.ref_id, itens.description ;
FROM supliers ;
LEFT OUTER JOIN itens ;
on itens.ref_id = supliers.ref_id ;
WHERE supliers.suplier_id = mysuplier_id_from_textbox ;
AND supliers.ref_id = myref_id_from_textbox

You may have it as SQL SELECT which recreates the cursor which is RecordSource for your grid (don't forget the set grid.RecordSource = "" before you re-issue your SQL . Or you may setup this as a view and REQUERY it, just make sure you have your input textboxes values available and assigned to view parameters ( mysuplier_id_from_textbox, myref_id_from_textbox)

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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform