Another way and perhaps easier to understand is to create a nonupdatable (just set it not to send updates) parameter view in your DBC that is set to whatever order you want in your report and then add the view to the data environment of the form being sure to set it to 'no data on load'. When you are ready for data set the value of your parameter and requery the view (=requery('myview')). This may use more resources than doing an SQL statement in code but it is a lot cleaner.
A problem is a problem only as long as it has a possible solution. Lacking that, it becomes a FACT!