Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid cursor relations
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00046819
Message ID:
00046913
Vues:
26
>>>>I've got grids for which I've created cursors for the rowsources. The Select-SQL statements that create the cursors are in my Form's Load event, then my Grid's recordsourcetype is Alias and recordsource is the specific cursor's name.
>>>>
>>>>I want to relate my grid's cursor to the parent field control on the same page (my structure is Form->Pageframe->Page->controls) so when users change the parent field at the top of the page via my navigation buttons, the results in the grid change to show the corresponding child info in the cursor.
>>>>
>>>>How do I do this and where do I do this?
>>>>
>>>>Thanks!
>>>>Mandy
>>>
>>>you can do this where you change the record. probably best to move the sql statements to their own method. you can then call this method in your form load and wherever you have code that will change the parent record. make sense?
>>
>>somewhat. can you fill in more details? I actually have my sql in their own code within my project (for testing purposes)...how do I call them from my form (and where of course :^) )?
>>
>>and where do I establish the relations from my cursors to my parent? I get confused what exists when and how to create relations with non 'official' tables with indexes, i.e. cursors and views
>>
>>Thanks!
>>Mandy
>
>Hi Mandy,
>Call the SQL code whenever you change the parent record (or in the form refresh if you want to limit the number of places you put the call). If you use the parent ID in your WHERE code, you won't need relations at all. Think "parameterized views".
>
>HTH
>Barbara

Mandy,

You might also put the SQL code in .BeforeOpenTables of the dataenvironment and set the .NoDataOnLoad property so that the query is not run. You can then issue the REQUERY("View Name") anywhere in some custom method as Dave suggested or anywhere and it will execute the query. If as Barbara suggested you keep the views parameterized, then create a property at the form level that holds the parameters for your query and fill these parameters just prior to issuing REQUERY().

Steve
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform