Hello again,
I'm trying to insert a lot number allocation on an order detail but I'm getting this error. Can someone please point out to me what I'm doing wrong? Thanks!
I'm trying to insert a lot number allocation on an order detail but I'm getting this error. Can someone please point out to me what I'm doing wrong? Thanks!
Code:
Private Sub adsOEORDDL_OnRecordChanged(ByVal eReason As AccpacCOMAPI.tagEventReason, ByVal pField As AccpacDataSrcCtl.IAccpacDSField, ByVal pMultipleFields As AccpacDataSrcCtl.IAccpacDSFields)
On Error GoTo ErrorHandler
If eReason = RSN_FIELDCHANGE Then
If pField.Name = "LOTNUMF" Then
strLotNo = adsOEORDDL.Fields("LOTNUMF").Value
ElseIf pField.Name = "QTY" Then
adsOEORDDL.SetFireEvents False
adsOEORDDL.GoBottom
adsOEORDDL.RecordClear
adsOEORDDL.RecordGenerate False
adsOEORDDL.Fields("LOTNUMF").PutWithoutVerification (strLotNo)
adsOEORDDL.Process
adsOEORDDL.Insert
adsOEORDDL.SetFireEvents True
qtyAllocated = qtyAllocated + pField.Value
lblAllocated.Caption = Format(qtyAllocated, "###,##0.0000")
qtyRemaining = qtyLotRequired - qtyAllocated
lblRemaining.Caption = Format(qtyRemaining, "###,##0.0000")
End If
End If
Exit Sub
ErrorHandler:
StdACCPACErrorHandler Me, mSession, mIResTmpl, True, True
End Sub