>Lutz - MS is quite happy to have code in the grid header click event -
https://msdn.microsoft.com/en-us/library/azc9x3f9%28v=vs.80%29.aspx, so I put code in there just to see if it works, and it does, but you have to physically click it.
>
>I tried making a method called 'gridorder' and putting the 'set order to' in there, and calling that, but that didn't work either.
Even if MS is happy, it's really not a good idea. If for instance you add code in an event, and you want to call that code from some other part of your project, that event will fire. The side effects can be unpredictable. So the rule that events call methods, is a good one. But of course it's your choice. To be honest, I used to have code in events earlier, but changed my mind after some really bad experiences including hours of head scratching. :-)
To your actual problem, make sure that your "Set order to " command line contains something like "in (This.recordsource)".