Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid / Table Relation / Form Refresh
Message
 
 
À
06/06/2002 04:34:31
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00665306
Message ID:
00665312
Vues:
17
Hi!

If you use parent-child relationship by SET RELATION command, it is a common problem with grids.

With SET RELATION, each time record pointer is changed in the master table, the record pointer is child table is automatically moved to the first child record. When you use grids, during grid refreshing record pointer is moved automatically, thuis causingthe behaviour you described. Youc an solve the problem partially by remembering the current record in a child table, then restoring it just after you did all actions by using GO command to set record pointer explicitly to newly added record.

Instead of SET RELATION command I would recommend you to use SET KEY filter, that works by the same way, but does not make connection with master record. You will require to change SET KEY setting for child tables each time record is changed in a master table. However, you will have much better control over grids refreshing, and no automatic record pointer changes.

Hope this helps.

>Dear All,
>
>I am using a formset with two forms. FRM_Orders and Frm_SHPT.
>
>I have 3 tables in my DE, CUSTOMER, ORDER and SHIPMENT.
>All the tables are related in PARENT, CHILD and GRANDCHILD(?) relationship.
>
>CUSTOMER table has field Cust ID;
>ORDER table gas fields Cust ID, Order ID;
>SHIPMENT TABLE has fields Order ID, Shipment ID, Shipment_date, Shipment_qty.
>
>I gave a Combo Box (Cust_id) and two grids (ORDERS & SHIPMENT) on my FRM_Orders.
>
>FRM_Shipment is for accepting Shipment details.
>
>The Problem:
>Whenever I add record to my SHIPMENT table, after append blank and replaceing appropriate foreign key fields (Order_ID), I display FRM_Shipment, for data entry.
>
>However, as soon as I display the form, the record pointer of SHIPMENT table moves to the top most record, instead of newly appended record, and displays that record data in the entry fields of FRM_Shipment form.
>
>I tried a lot to solve this problem, nothing works.
>
>Please Help.
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform