Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
One to Many Form - Sorting Detail Lines
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00697108
Message ID:
00697210
Views:
13
John,

Create an index on the child table with the key of;
 USE ChildTable
 INDEX ON PADL(Transform(Quote_no),20) + Density + Thickness TAG MyOrder
 USE
PADL pads the left with spaces so all entries are the same length.
TRANSFORM converts any other data type to character for the concatenation. I am assuming that density and thickness are already character data type, if not they also need the PADL and TRANSFORM added to them as in ...
 USE ChildTable
 INDEX ON PADL(Transform(Quote_no),20) + PADL(TRANSFORM(Density),20) + PADL(TRANSFORM(Thickness),20) TAG MyOrder
 USE
Now to use this index you need to set your grid's properties to ...
LinkMaster set to the name of the alias of the parent table
RelationalExpr set to Quote_no
ChildOrder set to MyOrder (or whatever name you gave the index tag when you created it above)
The reason this works is that the beginning of the index expression is your linking value between the tables. Since Fox stops comparing when the shorter value is exhausted it will find the matches in the child on Quote_no. However because the index's expression also includes the denstiy and thickness after the quote_no the records will be ordered on density + thickness within quote_no and you get the ordering that you want.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform