I can explain the issue with the help of an example. Assume that I've loaded the page (receive.htm) in IE and entered value 1 in the search box and pressed enter. Now you can view two records. I click on the first column of the first record (row). Now the getClientDetails function will be called and as a parameter to the function a value of 17.
You are trying to execute the following SQL statement in the getClientDetails function
var SQL = "Select * from receive1 where rid = " + rid;
In other words you are trying to retrieve a record from the recieve1 table whose rid field's value is 17. If you look at the recieve1 table you can find that there is no such record with the mentioned rid (17).
Another point in getClientDetails function is
You are using the above code to put the value into text boxes from the recordset object. If you check the receive1 table doesn't contain any of the mentioned fields. So mostly you've used an incorrect table name in your sql statement.
document.getElementById("txtid2").value = rs("ClId");
document.getElementById("txttype1").value = rs("type1");
document.getElementById("txttype2").value = rs("type2");
document.getElementById("txttype3").value = rs("type3");
I think either you pass incorrect value to the getClientDetails function and trying to retrieve record(s) from it which doesn't exists.
Another point I've noticed is that the table structure and the relationship you have is very very complex and it is really very difficult to understand what you are trying to do. You should have a flexible table structure and relationships then only you'll be able to maintain it efficiently. There is no point in making it complex unless it is complex. If things can be represented in simple manner then go for it.