Hi the good news is that I wanted this to happen, but I do have a question about it.<BR><BR>Error Type:<BR>Microsoft JET Database Engine (0x80040E21)<BR>The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again.<BR><BR>Code extract is as follows:<BR><BR><BR>cDta.BeginTrans<BR><BR>set r = server.CreateObject("ADODB.recordset")<BR>set rs = server.CreateObject("ADODB.recordset")<BR>set stkr = Server.CreateObject("ADODB.Recordset")<BR><BR>sele ct case Request.Form("nw")<BR> case "new"<BR> &#039;<BR> &#039; Add Quote Detail<BR> &#039;<BR> r.Open "QteQuote",cDta, adOpenStatic, adLockOptimistic <BR> r.AddNew<BR> r("ref") = NullCheck(Request.Form("ref"))<BR> r("client_name")= ZeroCheck(Request.Form("client_name"))<BR> r("d_ad1") = NullCheck(Request.Form("del_addr1"))<BR> r("d_ad2") = NullCheck(Request.Form("del_addr2"))<BR> r("d_ad3") = NullCheck(Request.Form("del_addr3"))<BR> r("d_ad4") = NullCheck(Request.Form("del_addr4"))<BR> r("d_cty") = NullCheck(Request.Form("del_county"))<BR> r("d_ctr") = NullCheck(Request.Form("del_country"))<BR> r("d_pcd") = NullCheck(Request.Form("del_pc"))<BR> r("i_ad1") = NullCheck(Request.Form("inv_addr1"))<BR> r("i_ad2") = NullCheck(Request.Form("inv_addr2"))<BR> r("i_ad3") = NullCheck(Request.Form("inv_addr3"))<BR> r("i_ad4") = NullCheck(Request.Form("inv_addr4"))<BR> r("i_cty") = NullCheck(Request.Form("inv_county"))<BR> r("i_ctr") = NullCheck(Request.Form("inv_country"))<BR> r("i_pcd") = NullCheck(Request.Form("inv_pc"))<BR> r("sts") = ZeroCheck(Request.Form("sts"))<BR> r("contact") = ZeroCheck(Request.Form("contact"))<BR> r("loc") = NullCheck(Request.Form("loc"))<BR> r("brief") = NullCheck(Request.Form("notes"))<BR> r("task") = 0<BR> r("sdate") = now()<BR> r("cdate") = null<BR> r("sby") = session("uid")<BR> r("cby") = 0<BR> r("start_date") = NullCheck(Request.Form("start_dated"))<BR> r("end_date") = NullCheck(Request.Form("end_dated"))<BR> r("inactive") = false<BR> r("clid") = ZeroCheck(Request.Form("cli_ref"))<BR> r.Update &#060;&#060;&#060; Error occuring correctly here<BR> r.Close<BR><BR> s = "select @@identity as intref"<BR> r.Open s,cDta, adOpenStatic, adLockOptimistic <BR> nrf = r("intref")<BR> r.Close<BR> &#039;<BR> &#039; Now add quote lines<BR> &#039;<BR> for ctr = 1 to Request.Form("lno")<BR> r.Open "QteLineDetail",cDta, adOpenStatic, adLockOptimistic <BR> r.AddNew<BR>....<BR>....<BR>ad nauseum<BR>....<BR>....<BR><BR>What I am stuck with though is the error trapping to ensure that I capture this event and spew out messages to the screen requesting the entry of a unique code instead of trying to add a duplicate one.<BR><BR>Regards<BR><BR>Mark