Are you trying to set the order of the main file? If so, then setting it in the DE should work. If it doesn't, then something in the code is changing it. It may be your framework, or anything else. Use the debugger with a break point on Order() or key().
If it's the grid, you must use an index that contains the linking field. However if you want to sort by date or a name inside the linking field use an index "Myid + dtos(InvoiceDate)" This would allow the grid to link to the master table by "Myid" but also sort on the date.
HTH
Barbara
>How do you set the sorting order on a form that has a database control toolbar on it (Top, Bottom, Next, Prev)? My form has one main file and several associated files linked by relationships. The form has two pages in a pageframe... page1 is the detail, page2 is a grid style list.
>
>The primary key on the main file is a unique ID field. I have another REGULAR key setup on a date in the file.
>
>I tried modifying the DE for the main file and selecting the date key under the ORDER property for the cursor.
>
>That doesn't seem to work. I also attempted to analyze the order that it does list in to no avail... it's not in any sequence I can tell what so ever.