>When printing using the new behavior in VFP 9, the set relation to works great when you have multiple bands that need to be associated with each other. What I'm having a problem with is sorting. If you set the child item relation to a code field but want the child items to print sorted by another field, how can you do this?
If your Set("Exact")=off (which it is, by default), you can index your detail cursor on the field used in relation plus the field you want for sorting, i.e. use a composite index. For example, if your child table is related to the parent table by a field called fld1, and you want it sorted by fld2, then you need an index on fld1+fld2.
Of course, this works for character indexes only - any other type needs to be converted by using transform(.., "picture here"), dtos() etc, while making sure that each of these conversions yields a string of fixed length.