*<BR> <BR>I am currently working on a page where users can search for a record using a non unique id number (duplicate numbers allowed). The record/s should then appear on the same page. When the user clicks on the record (currently, im using a javascript select function) and presses a "Remove" button, the record will be removed from the archive database and moved to another database table. <BR>THe script works fine if one record is displayed, but runs into problems when multiple records appear (since there are some records with identical id numbers)<BR>A loop is run so that each record will have a number appended at the end so that each record will be unique<BR><BR>Then when the user clicks on that record, only that record should be selected and moved. Im very new to this and I appreciate any help greatly. <BR>Below is part of the code for remove: (the search works ok)<BR><BR>Dim Action2, dbcars, dbArchive, Claim, Rego<BR>Set dbcars = Server.CreateObject("ADODB.Connection")<BR>dbcars. Open "Cars"<BR>Set dbArchive = Server.CreateObject("ADODB.Connection")<BR>dbArchi ve.Open "Archive"<BR>Action2 = UCase(Request("Action2"))<BR><BR><BR><BR>If Action2 = "RECOVER" Then<BR><BR>Set rscurrent = dbArchive.Execute ("SELECT * FROM Archive " & records & " WHERE Claimnumber = &#039" & Request.Form("ClaimNumber") & "&#039 AND Regonumber = &#039" & Request.form("RegoNumber") & "&#039")<BR><BR><BR>mcount=0<BR>Do While Not rscurrent.EOF<BR>mcount= mcount + 1<BR><BR><BR>If (Trim(Request.Form("SelectedVehicle" & Trim(Rscurrent("ClaimNumber")) & Trim(Rscurrent("RegoNumber")) & CStr(mcount))) = "") then<BR>&#039If (Trim(Request.Form("SelectedVehicle" & Trim(Rscurrent("ClaimNumber")) & Trim(Rscurrent("RegoNumber")) & CStr(mcount))) &#060;&#062; "" AND Trim(Rscurrent("SelectedVehicle" & Trim(Request.Form("ClaimNumber")) & Trim(Rscurrent("RegoNumber")) & CStr(mcount))) &#060;&#062; ",") THEN<BR><BR><BR>SQLQuery = "INSERT INTO Current (ClaimNumber, RegoNumber, Make, Model, Year, Type, Location,"<BR>SQLQuery = SQLQuery & " Description, TCDate, TCTime, Image1) " <BR>SQLQuery = SQLQuery & "VALUES (&#039" & Request.form("ClaimNumber") & "&#039, &#039" & Request.form("RegoNumber") & "&#039, &#039"<BR>SQLQuery = SQLQuery & rsCurrent("Make") & "&#039, &#039" <BR>SQLQuery = SQLQuery & rsCurrent("Model") & "&#039, &#039"<BR>SQLQuery = SQLQuery & rsCurrent("Year") & "&#039, &#039"<BR>SQLQuery = SQLQuery & rsCurrent("Type") & "&#039, &#039"<BR>SQLQuery = SQLQuery & rsCurrent("Location") & "&#039, &#039" <BR>SQLQuery = SQLQuery & rsCurrent("Description") & "&#039, &#039" & <BR>SQLQuery = SQLQuery & rsCurrent("Image") & "&#039) "<BR><BR><BR>dbcars.Execute (SQLQuery)<BR><BR>End If<BR>rsCurrent.MoveNext<BR>loop<BR><BR>rsCurrent. Close<BR>Set rsCurrent = Nothing<BR><BR><BR>Set rsCurrent = dbArchive.Execute ("SELECT * FROM Archive " & records & " WHERE ClaimNumber = &#039" & Request.form("ClaimNumber") & "&#039 AND RegoNumber = &#039" & Request.Form("RegoNumber") & "&#039 ")<BR><BR>mcount=0<BR>Do While Not rsCurrent.EOF<BR>mcount= mcount + 1<BR><BR><BR>If (Trim(Request.Form("SelectedVehicle" & Trim(Rscurrent("ClaimNumber")) & Trim(Rscurrent("RegoNumber")) & CStr(mcount))) = "") then<BR><BR>SQLQuery = "DELETE FROM Archive WHERE ClaimNumber = &#039"<BR>SQLQuery = SQLQuery & Request.form("SelectedVehicle" & Trim(Rscurrent("ClaimNumber")) & Trim(rscurrent("RegoNumber")) & CStr(mcount)) & "&#039"<BR><BR>If Trim(Rscurrent("RegoNumber")) &#060;&#062; "" then<BR>SQLQuery = SQLQuery & " AND RegoNumber = &#039" & Request.form("SelectedVehicle" & Trim(Rscurrent("RegoNumber")) & Trim(rscurrent("ClaimNumber")) & CStr(mcount)) & "&#039"<BR>End If<BR><BR>dbArchive.Execute (SQLQuery)<BR>End If<BR>rsCurrent.MoveNext<BR><BR>Loop<BR>rsCurrent. Close<BR>Set rsCurrent = Nothing <BR>end if %&#062;<BR><BR>thanks, <BR>Sue <BR> <BR>