Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to handle RowSourceType = 3 SQL Statement?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00447002
Message ID:
00447014
Vues:
9
>I have a Complaint combobox on a form and just below it I have a Subcomplaint combobox. In the Subcomplaint combobox I put an SQL SELECT as my RowSource and 3-SQL statement as my RowSourceType. When you pick a Complaint from the Complaint combobox it will show related Subcomplaints to choose from in the Subcomplaint combobox. Then, I want to be able to choose a Subcomplaint from the Subcomplaint combobox right after choosing a Complaint from the Complaint combobox.
>
>The Complaint combobox does nothing for the Subcomplaint combobox at this point in time.
>
>The Subcomplaint combobox looks back at the chosen item from the Complaint combobox using the SQL SELECT command as follows in the RowSource property of the combobox:
>
>SELECT lookup.desc, lookup.mailcode, lookup.code ;
    FROM lookup ;
    WHERE lookup.code = 28 ;
    AND ALLT(THISFORM.cboComplnt.List(THISFORM.cboComplnt.ListIndex,2)) = ALLT(lookup.mailcode)> ;
    <b>INTO CURSOR cuRowSource</b>
>

The select statement in a Rowsource needs the Into Cursor argument.



>I was wondering the best place to stick the USE lookup in 0 SHARED command?
>And the best place to stick the USE IN lookup command? To open and close the Lookup table so I avoid an error when the form runs and inits the Subcomplaint combobox.
>

Why not just open it in the Form.Load()? Or add it to the DE?


>And since I have the Complaint combobox right above this one. Where would be the best place to stick the Requery command. In case, I change the choice in the Complaint combobox which would alter the drop-down list in the Subcomplaint combobox.

I prefer the Click() event of the parent combo - Complaint in this case.
InteractiveChange() is bad, because it fires when you arrow around in the drop-down. Click() fires when the choice is actually made.
Insanity: Doing the same thing over and over and expecting different results.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform