Thanks Paul, for the explanation. BTW, your code automatically sorts the result data by SL. NO. How do I stop that?