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:
00055788
Views:
39
>>>>>>Gary, try a parameterized grid for your child1 and child2 records instead of letting the grid handle relationships. That way you can put any data you want in.
>>>>>>
>>>>>>The asterisks are the same as you will see if you do a Browse with 'set skip on'.
>>>>>>
>>>>>>HTH
>>>>>>Barbara
>>>>>
>>>>>That sounds great Barbara. What's a
>>>>>parameterized grid?
>>>>>
>>>>>thanks Gary
>>>>
>>>>ARGHH!! I meant a parameterized VIEW!
>>>>
>>>>Sorry,
>>>>Barbara
>>>
>>>I hate to sound so stupid but when I click on
>>>the first parent table what code would be there
>>>to make this happen. Could you give me an example?
>>>
>>>thanks
>>>Gary
>>
>>First you create a view:
>>   Create SQL View as Select field list from table1, table2 where ;
>>      table1.keyfield = table2.keyfield and .... order by ... ;
>>      into cursor CursorName
>>
>>
>>You then use the resulting cursor as the data source for the grid.
>
>Mark gave you the code for a regular view. A parameterized view simply adds one more clause in the WHERE section which can be updated programmatically
>
>   Create SQL View as Select field list from table1, table2 where ;
>      table1.keyfield = table2.keyfield;
> >>>     AND table2.SortField = ?MyVar;    <<<<
>      and .... order by ... ;
>        into cursor CursorName
>>
>
>Then be sure you have MyVar programmatically assigned the child value you want to see. You can re-assign MyVar and requery the view whenever Child1/Child2 change.


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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform