lckeyv=thisform.fieldaname lckey=alltrim(thisform.headername)+"."+alltrim(thisform.headerkey) do form genhelp with thisform.headername,thisform.fieldaname,thisform.fieldbname,; 1,thisform.frm_mode, "", 1, thisform.qfilter to lcsrch if thisform.frm_mode="E" or thisform.frm_mode="C" if !empty(lcsrch) select (thisform.detailname) locate go bott select (thisform.headername) scan for &lckeyv = lcsrch &lcfilter thisform.lcreckey=&lckey thisform.frm_doc_no=thisform.firstfield.value thisform.grdtotal exit endscan endif thisform.secondfield.setfocus else thisform.firstfield.setfocus endif Here's the lcreckey assign method LPARAMETERS vNewVal local lcreckey, lcfile THIS.lcreckey = m.vNewVal lcfile=select() lcreckey=this.lcreckey if lcreckey=0 thisform.lcpartyname="" endif select fheader if getnextmodified(0)<>0 =tablerevert(.t.,"fheader") endif =requery("fheader") select fdetail if getnextmodified(0)<>0 =tablerevert(.t.,"fdetail") endif =requery("fdetail") if thisform.autonumdoc="SI" or thisform.autonumdoc="PI" or thisform.autonumdoc="SV" or ; thisform.autonumdoc="PV" select tdocterm locate go bott select v_tdocterm if getnextmodified(0)<>0 =tablerevert(.t.,"v_tdocterm") endif =requery() thisform.m_redrawgrid2() endif if !empty(lcfile) select (lcfile) else select 0 endif thisform.refresh()The scan .. endscan loop in the search button code is where the problem lies. Although the search screen manages to retrieve the document number appended by other PCs, the scan can't locate the document number (hence can't return the surrogate key. The search screen is a form with default data session and hence is sharing with the base form.