Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parent/Child -> One to Many Question
Message
From
17/01/1999 04:58:46
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Parent/Child -> One to Many Question
Miscellaneous
Thread ID:
00176968
Message ID:
00176968
Views:
57
Hi Everyone.

I am relatively new to VFP coming from a 2.6 background. I have been working with a framework sample application that has set in a form's DE, a parent table related to a child "Orders" table and the "Orders" table is related by a common Orderno key. I assume this is the same as a "Set Relation To Orderno Into Orders" that I would programatically define in 2.6. The child table uses Optimistic Buffering.

A number of the framework data handling methods perform processes on the child table eg., summing the total value of the price field in "Orders" like ...

*- From the Parent table ...

Select Orders && the "related" child table in the DE
Sum Price To m.nTotal && scope by default "ALL" but only appears to see the "related" child records ??

My question is as follows. The code works and correctly sums the price of the orders. However, the Sum command (whilst in the child "Orders" table) only sees the Order records related to the current Parent record (like a filter is applied). The Sum command ignores other records in the Orders table that do not have an Orderno value that matches the current parent. If I set a relation in 2.6 and then selected a child table and issued a command with a scope of ALL, it would process all records in the table and not just those that were related to the parent table unless, of course, I restricted the command with a For or Having clause or Filter. In a Private Form DE where a One to Many relationship is defined, is the scope of the records in the related child table restricted to those records that match the defined relationship (like a filter has been applied without actually applying one).

TIA
-=Gary
Reply
Map
View

Click here to load this message in the networking platform