Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need Grid to Show All Child Records that Match Parent Key
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Need Grid to Show All Child Records that Match Parent Key
Environment versions
Visual FoxPro:
VFP 8
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01073370
Message ID:
01073370
Views:
96
I am trying to get a grid to show each child record that matches the key in the parent table. I put 3 records (1,2,3) into the parent table, and 4 (a,b,c,d) into the child table. If it were working properly, picking record 2 from the parent would show child records b and d in the grid. Instead, what is happening is that 4 rows appear; all of the columns to which I assigned a ControlSource are showing record b's data, and the columns without a ControlSource are showing data for each record (a,b,c,d).

In other words, instead of:
b,b,b,b,b (Row matching data in record b)
d,d,d,d,d (Row matching data in record d)

I'm getting:
b,b,a,b,a
b,b,b,b,b
b,b,c,b,c
b,b,d,b,d (Four rows, with a hodgepodge of record b and the sequential row)

I have tinkered with LinkMaster, ChildOrder, and RelationalExpr. I have tried SET KEY TO, REFRESH(), SET SKIP TO, and moving the record pointer. I have set up the relation in the LOAD, INIT, and ACTIVATE methods (not all at once), and in a new method that I created.
Right now, my code is:

*Init method
SELECT child
SET ORDER TO childindex
SELECT Parent
SET RELATION TO parentkey INTO child
SEEK tuParm1 &&Parameter passed from previous form

All of the other relevant properties are default.
How do I fix this problem?
Next
Reply
Map
View

Click here to load this message in the networking platform