Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
One-to-many grid problem
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00039816
Message ID:
00039944
Vues:
28
>>Hi ,
>>
>> I'm having trouble with a one-to-many grid. I can't access any record in the grid except the last one. All records are shown that relate to the record in the parent table, however if I try to change records using either the mouse or the arrow keys, it immediately changes back to the last record. Also no matter which table is currently selected, it changes to the parent table when I try to change records in the child. What 's going on? Can they make these grids any harder to work with?
>>
>>TIA
>>Mike
>
>Mike, Mark had some good ideas. However, you should also check your thisform.refresh (and any pageframe.refresh code) to see if anything there is re-setting the pointer between parent and child tables. For example, a SELCT PARENT might re-set the pointer to the first (or last, depending on indexes) child record. I had this problem once, and ended up with a custom refresh method.
>
>HTH
>Barbara

I also had the same problem. I found it is best to let the grid/form "auto-manage" what table is selected. If you have to issue a select statement in a method, make sure you "re-select" the original table before you leave a method or return control back to the form/grid. Most of this can be avoided by including the table alias in whatever function you are executing (e.g., tableupdate(.t.,.t.,"MyParentTable"), tablerevert(.t.,"ChildTable"), eof("ChildTable"), etc.).

To see what the form selects as the active table while you are testing the form, I "Set Status On" and note the table name/alias displayed in the status bar. This is where I learned what was going on as far as workarea selections. It was not what I expected.
Mark McCasland
Midlothian, TX USA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform