Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing variables between two combo boxes
Message
De
21/01/2013 13:28:04
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
21/01/2013 09:04:53
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01563450
Message ID:
01563508
Vues:
63
>>>I have a form with two combo boxes. The output from the first (i.e. the controlsource - say Thisform.var1) is to be used to determine the data displayed in the second combobox by means of a filter based on var1 in an SQL statement in the RowSource. What is the best way to pass the controlsource to the SQL statement? Thisform.var1 is not allowed in the SQL statement in the rowsource. I have got round it by using a private variable in the form but I feel this is not the correct way to do it.
>>
>>You can
>>
>>bindevent(thisform, "var1", combo2, "requery")
>>
>>and in the requery you can use aEvents() function to determine who called it, or you can go directly for luVar1=thisform.var1 and then use luVar1 in your SQL statement. You may bind the combo to the cursor instead of the statement, as you'd be running the statement programmatically (and I'm not sure if the variable would be visible in the SQL if you just set it in .requery() and then did a dodefault()).
>
>Thanks Dragan, that put me on the right track. I passed in Var1 as a parameter to the Requery of the second combo, and in the requery ran the SQL and set the rowsource of the second combo to the resulting cursor.

You mean it worked? :) Good.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform