Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Extra rows in grid because of 1 to many relationship
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00055512
Message ID:
00055928
Views:
34
>>Thanks I guess I'll try this. Maybe you could answer a question
>>for me then. In all seriousness. Isn't it easieer to use the
>>original way of having a 1 to many relationship set? Assuming
>>it worked of course. Why should one have to do all of this in
>>order for a simple relationship to work. Would you consider this
>>a bug in VFP?
>>
>>thanks again
>>Gary
>
>I didn't follow everything in this thread, but as I understand it, you've got three tables related, and two are in one grid. Grids are designed to handle one cursor at a time. Barbara explained to me in my thread how to use a parameterized view to fill a grid in my many-to-many form. I think that grids would be more complicated and quirky than they already are if they were made more flexible.
>
>In my many-to-many forms, I have table3 as a child of table1 and table2. My form would have text boxes for the fields of table1, and a grid with fields of table2 and one or more fields from table3. The fields of tables 2 and three are in a view with a join condition on table2.key = table3.table2key and table3.table1key = ?table1.key. Table1.key is a parameter of the view, written just like that, so I don't need to assign the parameter a value in code anywhere. I requery this view in my own refresh method.
>
>I also have a form with a relationship somewhat like yours, I think. Table1 is a parent of Table2, and table2 is a parent of Table3. The form has table1 fields in boxes, table2 in a grid, and table3 in another grid. Table2 is also a child of table4, relating table1 and table4 many-to-many. At the moment, table2 has duplicate fields from table4, so that I could use table2 by itself instead of making another parameterized view with table4. This is improper practice, but was an acceptable kludge at the time (I'm about to fix that). The relations make the second grid show the table3 records that are children of the currently selected record in table2. Code was written with the help of Mr. Anonymous Bureaucrat and others to make the selected record in table2 highlighted in its grid even when the grid does not have focus. I can dig up this code if you like.

Good reply, Bret. I'd like to add that Views allow you to show description fields from lookup tables as well, and you can order the view in multiple ways including on fields from the lookup tables which is difficult to do with Browse and Relationships.
Barbara Paltiel, Paltiel Inc.
Previous
Reply
Map
View

Click here to load this message in the networking platform