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:
00039919
Vues:
27
>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:

If the tables are already open before you run the form, check the DE to see if the form contains (loads) any of the 2 tables. If so, you may need to delete them from the DE. Otherwise, you need to make sure the 2 tables are related the way you expected. In the properties of the grid, under the DATA tab, make sure the child order is correct, the "Link Master" is the parent table, and the Record Source (usually set to the Child table) and Relational Expression properties are correct also.

I have better luck opening the tables first, set the orders and the relation then run the form (no tables are in the DE). I also have a custom form property (ThisForm.OldGridRow) that is set to the ThisForm.Grid1.ActiveRow of the grid and is checked in the BeforeRowColChange event. If the ActiveRow of the Grid is different than the value stored in the OldGridRow, I do a ThisForm.Refresh(), then reset the OldGridRow to the new ActiveRow of the grid. If the ActiveRow is the same (ThisForm.OldGridRow=This.ActiveRow), nothing happens (only the column changed).

HTH.
Mark McCasland
Midlothian, TX USA
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform