i have some code
PORCP1header.Order = 0
PORCP1headerFields.FieldByName("RCPHSEQ").PutWithoutVerification("0") ' Receipt Sequence Key
PORCP1header.Init()
PORCP1header.Order = 1
temp = PORCP1detail1.Exists
PORCP1detail1.RecordClear()
PORCP1detail3.RecordClear()
temp = PORCP1detail4.Exists
PORCP1detail4.RecordClear()
PORCP1detail6.Init()
PORCP1detail2.Init()
PORCP1headerFields.FieldByName("RCPNUMBER").Value = dtRead("RCPNUMBER").ToString ' Receipt Number
temp = PORCP1header.Exists
PORCP1headerFields.FieldByName("VDCODE").Value = dtRead("VDCODE").ToString ' Vendor
PORCP1headerFields.FieldByName("PROCESSCMD").PutWithoutVerification("1") ' Command
PORCP1header.Process()
PORCP1headerFields.FieldByName("PONUMBER").Value = dtRead("PONUMBER").ToString ' Purchase Order Number
PORCP1header.Order = 0
PORCP1detail5Fields.FieldByName("LOADPORNUM").Value = dtRead("PONUMBER").ToString ' Purchase Order Number
PORCP1detail5Fields.FieldByName("FUNCTION").PutWithoutVerification("4") ' Function
PORCP1detail5.Process()
PORCP1header.Order = 1
PORCP1detail3Fields.FieldByName("PROCESSCMD").PutWithoutVerification("1") ' Command
PORCP1detail3.Process()
PORCP1detail1Fields.FieldByName("RCPLREV").PutWithoutVerification("-1") ' Line Number
PORCP1detail1.Read()
PORCP1detail1Fields.FieldByName("RQRECEIVED").Value = dtRead("RQRECEIVED").ToString ' Quantity Received
PORCP1detail1.Update()
PORCP1detail1Fields.FieldByName("RCPLREV").PutWithoutVerification("-1") ' Line Number
PORCP1detail1.Read()
PORCP1headerFields.FieldByName("DATE").Value = Date.Parse(dtRead("xDATE").ToString) ' Receipt Date
PORCP1detail5Fields.FieldByName("FUNCTION").Value = "61" ' Function
PORCP1detail5.Process()
PORCP1detail1Fields.FieldByName("RCPLREV").PutWithoutVerification("-1") ' Line Number
PORCP1detail1.Read()
PORCP1detail1Fields.FieldByName("UNITCOST").Value = dtRead("RQRECEIVED").ToString ' Unit Cost
temp = PORCP1detail1.Exists
PORCP1detail1.Update()
PORCP1detail1Fields.FieldByName("RCPLREV").PutWithoutVerification("-1") ' Line Number
PORCP1detail1.Read()
PORCP1headerFields.FieldByName("DATE").Value = Date.Parse(dtRead("xDATE").ToString) ' Receipt Date
PORCP1detail5Fields.FieldByName("FUNCTION").Value = "61" ' Function
PORCP1detail5.Process()
PORCP1detail1Fields.FieldByName("RCPLREV").PutWithoutVerification("-1") ' Line Number
PORCP1detail1.Read()
PORCP1detail1Fields.FieldByName("ITEMDESC").Value = dtRead("DESC").ToString ' Item Description
temp = PORCP1detail1.Exists
temp = PORCP1detail1.Exists
PORCP1detail1Fields.FieldByName("GLNONSTKCR").Value = dtRead("GLNONSTKCR").ToString ' Non-Stock Clearing Account
temp = PORCP1detail1.Exists
temp = PORCP1detail1.Exists
PORCP1detail1.Update()
temp = PORCP1detail1.Exists
temp = PORCP1detail1.Exists
PORCP1detail1Fields.FieldByName("RCPLREV").PutWithoutVerification("-1") ' Line Number
PORCP1detail1.Read()
temp = PORCP1detail1.Exists
PORCP1detail5Fields.FieldByName("FUNCTION").PutWithoutVerification("8") ' Function
PORCP1detail5.Process()
PORCP1detail3.Init()
PORCP1detail1Fields.FieldByName("RCPLREV").PutWithoutVerification("-1") ' Line Number
temp = PORCP1detail1.Exists
PORCP1detail1Fields.FieldByName("RCPLREV").PutWithoutVerification("-1") ' Line Number
PORCP1detail1.Read()
PORCP1detail3.Browse("(RCPHSEQ = 5763494)", 1)
PORCP1detail3.RecordClear()
PORCP1detail5Fields.FieldByName("FUNCTION").PutWithoutVerification("10") ' Function
PORCP1detail5.Process()
temp = PORCP1header.Exists
PORCP1header.Insert()
PORCP1detail5Fields.FieldByName("RCPHSEQ").PutWithoutVerification("5763494") ' Receipt Sequence Key
PORCP1detail5Fields.FieldByName("FUNCTION").PutWithoutVerification("2") ' Function
PORCP1detail5.Process()
PORCP1header.Init()
PORCP1header.Order = 0
PORCP1headerFields.FieldByName("RCPHSEQ").PutWithoutVerification("0") ' Receipt Sequence Key
PORCP1header.Init()
PORCP1header.Order = 1
temp = PORCP1detail1.Exists
PORCP1detail1.RecordClear()
PORCP1detail3.RecordClear()
temp = PORCP1detail4.Exists
PORCP1detail4.RecordClear()
PORCP1detail6.Init()
PORCP1detail2.Init()
in the red line. the code error with result Error HRESULT E_FAIL has been returned from a call to a COM component.