Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Relation problems with 2 tables
Message
De
11/07/2002 02:04:59
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
09/07/2002 20:42:54
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00676880
Message ID:
00677407
Vues:
18
>I have 2 buffered tables that have a one-to-many relation on a maintenance form. There are several bound controls for editing the parent table fields; other controls are bound to the child. A grid is used to navigate between records of the child.
>
>If going to the second record in the child and then edit the parent-bound field on the form, the child record pointer jumps to the first record. Note, that the parent field has nothing to do with the relation expression. I would certainly prefer the pointer to stay on the second record, or to move it back to the second record (if this is not avoidable in FoxPro).
>
>I was trying with and without SET SKIP TO, by using and not using the grid's
>ChildOrder, LinkMaster and RelationalExpr properties - it doesn't help.
>
>There is more to it. While entering specific information in the child, I had to update the parent on the fly. So, I saved the work area, which is the parent; selected the child, saved its current record and did some calculation. Then, programmatically updated the field in the parent. While looking in debugger, I see that the child record stays where it was left at - not moving to the first one. When restoring the work area (selecting the parent), the child pointer jumps to the first record.
>
>Still in control: moving it back with "GO nRecNo IN Child". But, the weird thing is that while I am in the described method, the pointer stays where it supposed to be. As quickly as the form gets the focus, the pointer is on the first record. -( I was trying to set a breakpoint on the change of the pointer in the child - it doesn't caching the change at all: I see the change in the Watch window but the message doesn't come up. I was trying to define events firing after moving the child record to the
>
>right one and before I see it in the wrong place on the form. There were none (which is right - I was just calling a user defined method in a LostFocus).
>
>I also had other bad situations with this freaking pointer but the application is heavily relying on the relation being in place - the rewriting for querying, filtering or another technique is not an option.
>
>Please help.
>
>Thank you.

Aleksandr,
It's the basic behaviour of related tables. If you don't want child pointer automatically jump to first, do not refresh form, or do not unselect/select parent. If you can't control w/o doing these than do not use relations.
If you'd go with relations, simply keep record number before anything that'd force the pointer to move (like selecting parent).
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform