This is all new to me - my Java knowledge is very limited (practically non-existent) - I've just had a go and I still can't seem to get it to work with my form. I've even tried taking out the drop down box and changing it to a text box, still nothing.
It could be one of many issues, so without seeing the form it is difficult to say.
Can you share the form? If so, upload it to a file sharing site; publish it and post the published URL here. I will try and take a look when I can.
You were just missing the script object (SubformSort), which contains a function (sort), as well as other functions. I have inserted this into the form for you: https://acrobat.com/#d=U-kS2UvpSs5BTQOyxZuRrg.
You can have a look at some screenshots here that discuss script objects: http://assure.ly/yDtfsM.
Hope that helps,
Thank you very much - it now does exactly what i needed it to do - I think though I need to go on a course or something - there is so much to learn.
Once again, many thanks for your help, much appreciated!