Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sorry for being a numbskull - a grid question
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00065305
Message ID:
00065566
Views:
32
>>Hi folks, I am using VFP 3.0b for Windows.
>>
>>I have a really fundamental question about creating a 1 - many form that uses tables directly (no arrays, no views, no cursors).
>>
>>There seems to be two "true" VFP ways to create the form and set the relation between the two tables.
>>
>>1) Use the grid builder, this then sets the relation between the two tables. It seems in this case the tables don't have to be in the data environment.
>>
>>2) Put the tables into the data environment. Use drag and drop to relate the tables (if a persistent one doesn't already exist). Drag and drop the child table onto the form. The grid builder can then be run to set up the columns (not necessary), but the relation is not set between the two tables since the relation is set in the data environment.
>>
>>I have a few questions about these two methods, so I hope someone has time to answer them.
>>
>>A) Am I correct that these are two different methods, or am I confused?
>>
>>B) Which is the best method?
>>
>>C) I am using method 2, but I can't get the order of the child table in the grid. RFID is the primary key in the parent table and RFID is the foreign key in the child table. How do I set the child order. The child has a compound key that is a combination of RFID (foreign key) and date. This is the order that I would like the child table to be in. I can't get the form to child records to display in the grid properly by using the compound key or by setting the childorder property (in the dataenvironment) to what I want.
>>
>>So... if anyone can lend a hand to a rambling numbskull, I would appreciate it.
>
>For a 'numbskull question', you sure got a lot of participation in your quandry ;-)
>
>I handle grids a little differently, Evan, so I'm going to add my 2-cents US.
>
>1. Put parent and child tables into the DE (no relationship, if a relation shows, delete it in the DE, not the DBC)
>
>2. Set index to the foreign key in the child table, but add the sort-order to that index. The key would be "FK + LastName" to sort by last name inside the grid. Index tags are 'cheap' Add a couple if you need to change sort orders - FK + Company, FK + Region, etc.
>
>3. Use the grid properties (LinkMaster, ChildOrder) to set the parent child relationships.
>
>I've had excellent success with this method.
>
>HTH
>Barbara

I agree with Barbara. I've tried setting the relationship in DE in parent-child based forms with inconsistant results. Actually, only way I could get one such forms to work was to do exactly what Barbara said: Delete the default relationship set in the DE and use Linkmaster and RelationalExpr property of the grid. Otherwise, I just use a parameterized view.

John.
It's "my" world. You're just living in it.
Previous
Reply
Map
View

Click here to load this message in the networking platform