Sort before Show All

So .... I've managed to create my search and navigation buttons. Everything works fine EXCEPT .... when I click on "Show All" after viewing search results, the records are no longer sorted.

If I exit the form and then re-enter everything gets sorted again. Whilst that produces the desired result, that's hardly an acceptable way of using the form.

I've tried everything I can think of. The most logical, I would have thought, is to put a script on the "Show All" button, telling it to sort before showing the records. ... but it doesn't work. I've also tried script triggers on the form itself and script triggers on the button.