Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parent-child refreshing problem
Message
From
28/09/1998 15:40:20
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00141038
Message ID:
00141594
Views:
34
Thanks all, but still not working.
I tried several ways. It seems like the ChildOrder property is causing problem. My form is very simple: two grids, two tables in Dataenvironment.
In form designer grid1.RecordSource = table1
                 grid2.RecordSource = table2
                 grid2.RelationnalExpr = field1
                 grid2.LinkMaster = table1
With those settings, both grids show all records of table1 and table2 which is correct.
If I add grid2.ChildOrder = field2, then grid2 is empty when I run the form!!!

I also tried to add a relation in form.load():
   ThisForm.DataEnvironment.CloseTables
   ThisForm.DataEnvironment.AddObject('newRelation','Relation')
   ThisForm.DataEnvironment.newRelation.ChildOrder='field2'
   ThisForm.DataEnvironment.newRelation.RelationalExpr='field1'
   ThisForm.DataEnvironment.newRelation.ChildAlias='table2'
   ThisForm.DataEnvironment.newRelation.ParentAlias='table1'
   ThisForm.DataEnvironment.OpenTables
This produces also an empty grid2!!!

Third way:
With only RecordSource property of both grids set, I ran the form with dataSession window opened and created my relation from the dataSession window. Once the relation is created, grid2 responds correctly to selection made in table1.
If this method worked, why didn't method 2 work out?


I'm using Visual FoxPro 5.0.
Is this a bug, is it fixed in 5.0a or 6.0??

Thank you
Claude


>>In a form I have a grid with RecordSource set to Table1.
>I also have a textbox linked to a field of Table2.
>
>>In the grid I want to see only related records to the current record of Table2.
>
>>My grid has
>>LinkMaster = Table2
>>RelationalExpr = aField
>
>>But the grid always shows the entire content of Table1 ???
>
>>I tought this would work. Did I forget something.
>
>>Thanks
>
>need childorder property. can also try "goto recno("parent table")" in the grid init (or any other appropriate time), to reestablish the parent pointer, which should readjust the child pointer. can also try not having focus set on the grid when you do a grid.refresh.
>
>i had many child/parent grids defined like you in the grids pem. dropped them all. i am a new vfp, so there are tricks i do not know - but my grids were so finicky that i could not stand it anymore. coming in the first time, if there were records to show in the grid they would show all the records. if there were no records to show, they would flicker with the last record of the data set (long enough i could read which record it was) then go blank. finally made a temp table with only the subset of records i needed and only displayed those.
>
>most people on ut say to use a parameterized view. this was not appropriate for me. you need your tables to be in databases and unique indexes on the tables for update.
>
>brenda
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform