Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with grids and multiple relationships
Message
From
25/04/2001 10:18:03
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00499076
Message ID:
00499564
Views:
19
Joel,

This exact problem plagued me several months ago. I finally identified it as a known bug, and Microsoft has a workaround for it on the MSDN site. I'm going to search for the KB# and if I can find it, I'll post it. Otherwise, I'd recommend searching the site for something like "relationships" and "grids" in VFP.

>I am having a problem with a grid when the recordsource for the grid has relationships set into more than one parent table. In my scenario, I am adding items to a package. For each line item, I show the description and the item category name. The item description and category name are displayed by means of a relationship between the line item and the parent tables. When the item code is changed on the line item, I get inconsistent behavior. Sometimes I receive a "Record out of Range" error. Other times the grid turns white and all columns and rows disappear. When I'm lucky the item description and category name will both be updated, but when this happens one of them will contain the wrong value. I've confirmed that the incorrectly displayed value is the same record number as the correctly displayed one. In other words, if the category name is displayed correctly and is record number 9, I will see the description for record number 9 in the items table. Has anyone else run into
>this problem before?
>
>I've been able to duplicate the problem with VFP sample data. If you'd like to do the same, use the data in the Data folder of the VFP98 samples directory. Use the following steps:
>
>1. On a new form, add the orditems, orders, and products tables to the data environment.
>2. Remove the automatic relationships.
>3. Set a relationship from the order_id field in orditems to the order_id index in orders.
>4. Set a relationship from the product_id field in orditems to the product_id index in products.
>5. Add a grid to the form with orditems as the recordsource and columns for orditems.order_id, orditems.product_id, orders.to_address, and products.prod_name.
>6. Save and run the form.
>
>I know this isn't a realistic setup, but it illustrates the problem I have in my real world scenario. On my computer, when I change the value of the order_id to another valid value (say " 10001"), the address updates properly, but the product name is also changed incorrectly to show the record in the products table with the same record number of the record in the orders table. Do you get the same results?
>
>I would really appreciate some help with this one. I've been wrestling with it for over two days now, and it's worth a lot of points <g>. Thanks.
Previous
Reply
Map
View

Click here to load this message in the networking platform