Error 130 on OrderModify || order modified few times and then start sending error - page 2

 
Anil Varma:

Thanks again for prompt reply Mehmet.

attached is the final version of full code. It is working fine (no Error 130, 1 or 0) except when more then one order is opened, it update only the latest one. So while i was testing for three years data, realised that when order 2 opened, it modified it. However after simultaneous opening of order 3, it did modified order 3 but not 2. When order 3 was closed earlier then 2, it again modified order 2.

Also let me know the relevance or importance of having RETURN (highlighted) just before the close of For Loop ... It seems this is the one causing problem to update multiple records at same time!!!

Could you please add the ND function here?