AccPal
Programmer
- Jun 13, 2009
- 8
Hi All
Im fairly new to the Accpac Com API ive recorded a macro
and inserted the code on to a button control in VB 2008
what will i need to do from here a connection string ETC
ive referenced Com api and it now is happy with AccpacCOMAPI
but its not happy with OpenDBLink(DBLINK_COMPANY, DBLINK_FLG_READWRITE) it says its not declared
macro that was recorded
' Sage Accpac Macro file: D:\A4W\oe.AVB
' Recorded at: Sat Jun 13 11:58:46 2009
'
On Error GoTo ACCPACErrorHandler
' TODO: To increase efficiency, comment out any unused DB links.
Dim mDBLinkCmpRW As AccpacCOMAPI.AccpacDBLink
mDBLinkCmpRW = OpenDBLink(DBLINK_COMPANY, DBLINK_FLG_READWRITE)
Dim mDBLinkSysRW As AccpacCOMAPI.AccpacDBLink
mDBLinkSysRW = OpenDBLink(DBLINK_SYSTEM, DBLINK_FLG_READWRITE)
Dim temp As Boolean
Dim OEORD1header As AccpacCOMAPI.AccpacView
Dim OEORD1headerFields As AccpacCOMAPI.AccpacViewFields
mDBLinkCmpRW.OpenView("OE0520", OEORD1header)
OEORD1headerFields = OEORD1header.Fields
Dim OEORD1detail1 As AccpacCOMAPI.AccpacView
Dim OEORD1detail1Fields As AccpacCOMAPI.AccpacViewFields
mDBLinkCmpRW.OpenView("OE0500", OEORD1detail1)
OEORD1detail1Fields = OEORD1detail1.Fields
Dim OEORD1detail2 As AccpacCOMAPI.AccpacView
Dim OEORD1detail2Fields As AccpacCOMAPI.AccpacViewFields
mDBLinkCmpRW.OpenView("OE0740", OEORD1detail2)
OEORD1detail2Fields = OEORD1detail2.Fields
Dim OEORD1detail3 As AccpacCOMAPI.AccpacView
Dim OEORD1detail3Fields As AccpacCOMAPI.AccpacViewFields
mDBLinkCmpRW.OpenView("OE0180", OEORD1detail3)
OEORD1detail3Fields = OEORD1detail3.Fields
Dim OEORD1detail4 As AccpacCOMAPI.AccpacView
Dim OEORD1detail4Fields As AccpacCOMAPI.AccpacViewFields
mDBLinkCmpRW.OpenView("OE0680", OEORD1detail4)
OEORD1detail4Fields = OEORD1detail4.Fields
Dim OEORD1detail5 As AccpacCOMAPI.AccpacView
Dim OEORD1detail5Fields As AccpacCOMAPI.AccpacViewFields
mDBLinkCmpRW.OpenView("OE0526", OEORD1detail5)
OEORD1detail5Fields = OEORD1detail5.Fields
Dim OEORD1detail6 As AccpacCOMAPI.AccpacView
Dim OEORD1detail6Fields As AccpacCOMAPI.AccpacViewFields
mDBLinkCmpRW.OpenView("OE0522", OEORD1detail6)
OEORD1detail6Fields = OEORD1detail6.Fields
Dim OEORD1detail7 As AccpacCOMAPI.AccpacView
Dim OEORD1detail7Fields As AccpacCOMAPI.AccpacViewFields
mDBLinkCmpRW.OpenView("OE0501", OEORD1detail7)
OEORD1detail7Fields = OEORD1detail7.Fields
Dim OEORD1detail8 As AccpacCOMAPI.AccpacView
Dim OEORD1detail8Fields As AccpacCOMAPI.AccpacViewFields
mDBLinkCmpRW.OpenView("OE0502", OEORD1detail8)
OEORD1detail8Fields = OEORD1detail8.Fields
Dim OEORD1detail9 As AccpacCOMAPI.AccpacView
Dim OEORD1detail9Fields As AccpacCOMAPI.AccpacViewFields
mDBLinkCmpRW.OpenView("OE0504", OEORD1detail9)
OEORD1detail9Fields = OEORD1detail9.Fields
Dim OEORD1detail10 As AccpacCOMAPI.AccpacView
Dim OEORD1detail10Fields As AccpacCOMAPI.AccpacViewFields
mDBLinkCmpRW.OpenView("OE0503", OEORD1detail10)
OEORD1detail10Fields = OEORD1detail10.Fields
OEORD1header.Compose(Array(OEORD1detail1, OEORD1detail4, OEORD1detail3, OEORD1detail2, OEORD1detail5, OEORD1detail6))
OEORD1detail1.Compose(Array(OEORD1header, OEORD1detail7, OEORD1detail10, OEORD1detail8))
OEORD1detail2.Compose(Array(OEORD1header))
OEORD1detail3.Compose(Array(OEORD1header, OEORD1detail1))
OEORD1detail4.Compose(Array(OEORD1header, OEORD1detail1))
OEORD1detail5.Compose(Array(OEORD1header))
OEORD1detail6.Compose(Array(OEORD1header))
OEORD1detail7.Compose(Array(OEORD1detail1))
OEORD1detail8.Compose(Array(OEORD1detail1, OEORD1detail9))
OEORD1detail9.Compose(Array(OEORD1detail8))
OEORD1detail10.Compose(Array(OEORD1detail1))
OEORD1headerFields("DRIVENBYUI").Value = "1" ' Driven by UI
OEORD1detail1Fields("DRIVENBYUI").Value = "1" ' Driven by UI
OEORD1header.Cancel()
OEORD1header.Cancel()
temp = OEORD1header.Exists
OEORD1header.Init()
OEORD1detail2.Browse("", 1)
OEORD1detail2.Fetch()
OEORD1headerFields("CUSTOMER").Value = "AIR001" ' Customer Number
OEORD1detail2.Browse("", 1)
OEORD1detail2Fields("PAYMENT").PutWithoutVerification("-32767") ' Payment Number
OEORD1detail2.Browse("", -1)
OEORD1detail2.Fetch()
OEORD1headerFields("PROCESSCMD").PutWithoutVerification("1") ' Process OIP Command
OEORD1header.Process()
OEORD1headerFields("CUSTOMER").Value = "BAK001" ' Customer Number
OEORD1detail2.Browse("", 1)
OEORD1detail2Fields("PAYMENT").PutWithoutVerification("-32767") ' Payment Number
OEORD1detail2.Browse("", -1)
OEORD1detail2.Fetch()
OEORD1headerFields("PROCESSCMD").PutWithoutVerification("1") ' Process OIP Command
OEORD1header.Process()
OEORD1headerFields("TEMPLATE").Value = "DEF" ' Template Code
OEORD1detail2.Browse("", 1)
OEORD1detail2Fields("PAYMENT").PutWithoutVerification("-32767") ' Payment Number
OEORD1detail2.Browse("", -1)
OEORD1detail2.Fetch()
temp = OEORD1header.Exists
OEORD1headerFields("GOCALCTAX").PutWithoutVerification("1") ' Perform Tax Calculation
OEORD1header.Process()
OEORD1headerFields("PONUMBER").Value = "P012345" ' Purchase Order Number
temp = OEORD1detail1.Exists
OEORD1detail1.RecordClear()
temp = OEORD1detail1.Exists
OEORD1detail1.RecordCreate(0)
OEORD1detail1Fields("ITEM").Value = "1000" ' Item
OEORD1detail1Fields("PROCESSCMD").PutWithoutVerification("1") ' Process Command
OEORD1detail1.Process()
OEORD1detail1Fields("DESC").Value = "Consulting Accpac123" ' Description
OEORD1detail1Fields("QTYORDERED").Value = "1.0000" ' Quantity Ordered
OEORD1detail1.Insert()
OEORD1detail1Fields("LINENUM").PutWithoutVerification("-1") ' Line Number
OEORD1detail1.Read()
temp = OEORD1detail1.Exists
OEORD1detail1.RecordCreate(0)
OEORD1detail1Fields("LINENUM").PutWithoutVerification("-1") ' Line Number
OEORD1detail1.Read()
temp = OEORD1detail1.Exists
OEORD1detail1.RecordCreate(0)
OEORD1detail1Fields("ITEM").Value = "1100" ' Item
OEORD1detail1Fields("PROCESSCMD").PutWithoutVerification("1") ' Process Command
OEORD1detail1.Process()
OEORD1detail1Fields("QTYORDERED").Value = "60.0000" ' Quantity Ordered
OEORD1detail1.Insert()
OEORD1detail1Fields("LINENUM").PutWithoutVerification("-3") ' Line Number
OEORD1detail1.Read()
OEORD1headerFields("OECOMMAND").Value = "4" ' Process O/E Command
OEORD1header.Process()
OEORD1header.Insert()
OEORD1header.Order = 1
OEORD1header.Read()
OEORD1header.Order = 0
OEORD1detail1Fields("LINENUM").PutWithoutVerification("-32767") ' Line Number
OEORD1detail1.Browse("", 1)
OEORD1detail1.Fetch()
OEORD1detail8Fields("PRNCOMPNUM").PutWithoutVerification("-2147483647") ' Parent Component Number
OEORD1detail8Fields("COMPNUM").PutWithoutVerification("-2147483647") ' Component Number
OEORD1detail8.Browse("", 1)
OEORD1detail8.Fetch()
OEORD1detail4Fields("UNIQUIFIER").PutWithoutVerification("-32767") ' Uniquifier
OEORD1detail4.Browse("", 1)
OEORD1detail4.Fetch()
OEORD1detail3Fields("UNIQUIFIER").PutWithoutVerification("-32767") ' Uniquifier
OEORD1detail3.Browse("", 1)
OEORD1detail3.Fetch()
OEORD1detail2Fields("PAYMENT").PutWithoutVerification("-32767") ' Payment Number
OEORD1detail2.Browse("", -1)
OEORD1detail2.Fetch()
OEORD1detail2Fields("PAYMENT").PutWithoutVerification("-3") ' Payment Number
OEORD1detail2.Browse("", 1)
OEORD1detail2Fields("PAYMENT").PutWithoutVerification("-32767") ' Payment Number
OEORD1detail2.Browse("", -1)
OEORD1detail2.Fetch()
temp = OEORD1header.Exists
OEORD1headerFields("GOSHIPALL").Value = "1" ' Perform Ship All
OEORD1header.Process()
OEORD1headerFields("OECOMMAND").Value = "4" ' Process O/E Command
OEORD1header.Process()
temp = OEORD1header.Exists
OEORD1header.Update()
OEORD1header.Order = 1
OEORD1header.Read()
OEORD1header.Order = 0
OEORD1detail1Fields("LINENUM").PutWithoutVerification("-32767") ' Line Number
OEORD1detail1.Browse("", 1)
OEORD1detail1.Fetch()
OEORD1detail8Fields("PRNCOMPNUM").PutWithoutVerification("-2147483647") ' Parent Component Number
OEORD1detail8Fields("COMPNUM").PutWithoutVerification("-2147483647") ' Component Number
OEORD1detail8.Browse("", 1)
OEORD1detail8.Fetch()
OEORD1detail4Fields("UNIQUIFIER").PutWithoutVerification("-32767") ' Uniquifier
OEORD1detail4.Browse("", 1)
OEORD1detail4.Fetch()
OEORD1detail3Fields("UNIQUIFIER").PutWithoutVerification("-32767") ' Uniquifier
OEORD1detail3.Browse("", 1)
OEORD1detail3.Fetch()
OEORD1detail2Fields("PAYMENT").PutWithoutVerification("-32767") ' Payment Number
OEORD1detail2.Browse("", -1)
OEORD1detail2.Fetch()
OEORD1detail2.Browse("", 1)
OEORD1detail2Fields("PAYMENT").PutWithoutVerification("-32767") ' Payment Number
OEORD1detail2.Browse("", -1)
OEORD1detail2.Fetch()
temp = OEORD1header.Exists
OEORD1header.Order = 1
OEORD1header.Read()
OEORD1header.Order = 0
OEORD1detail1Fields("LINENUM").PutWithoutVerification("-32767") ' Line Number
OEORD1detail1.Browse("", 1)
OEORD1detail1.Fetch()
OEORD1detail8Fields("PRNCOMPNUM").PutWithoutVerification("-2147483647") ' Parent Component Number
OEORD1detail8Fields("COMPNUM").PutWithoutVerification("-2147483647") ' Component Number
OEORD1detail8.Browse("", 1)
OEORD1detail8.Fetch()
OEORD1detail4Fields("UNIQUIFIER").PutWithoutVerification("-32767") ' Uniquifier
OEORD1detail4.Browse("", 1)
OEORD1detail4.Fetch()
OEORD1detail3Fields("UNIQUIFIER").PutWithoutVerification("-32767") ' Uniquifier
OEORD1detail3.Browse("", 1)
OEORD1detail3.Fetch()
OEORD1detail2Fields("PAYMENT").PutWithoutVerification("-32767") ' Payment Number
OEORD1detail2.Browse("", -1)
OEORD1detail2.Fetch()
OEORD1detail2.Browse("", 1)
OEORD1detail2Fields("PAYMENT").PutWithoutVerification("-32767") ' Payment Number
OEORD1detail2.Browse("", -1)
OEORD1detail2.Fetch()
temp = OEORD1header.Exists
Exit Sub
ACCPACErrorHandler:
Dim lCount As Long
Dim lIndex As Long
If Errors Is Nothing Then
MsgBox(Err.Description)
Else
lCount = Errors.Count
If lCount = 0 Then
MsgBox(Err.Description)
Else
For lIndex = 0 To lCount - 1
MsgBox(Errors.Item(lIndex))
Next
Errors.Clear()
End If
Resume Next
End If
Im fairly new to the Accpac Com API ive recorded a macro
and inserted the code on to a button control in VB 2008
what will i need to do from here a connection string ETC
ive referenced Com api and it now is happy with AccpacCOMAPI
but its not happy with OpenDBLink(DBLINK_COMPANY, DBLINK_FLG_READWRITE) it says its not declared
macro that was recorded
' Sage Accpac Macro file: D:\A4W\oe.AVB
' Recorded at: Sat Jun 13 11:58:46 2009
'
On Error GoTo ACCPACErrorHandler
' TODO: To increase efficiency, comment out any unused DB links.
Dim mDBLinkCmpRW As AccpacCOMAPI.AccpacDBLink
mDBLinkCmpRW = OpenDBLink(DBLINK_COMPANY, DBLINK_FLG_READWRITE)
Dim mDBLinkSysRW As AccpacCOMAPI.AccpacDBLink
mDBLinkSysRW = OpenDBLink(DBLINK_SYSTEM, DBLINK_FLG_READWRITE)
Dim temp As Boolean
Dim OEORD1header As AccpacCOMAPI.AccpacView
Dim OEORD1headerFields As AccpacCOMAPI.AccpacViewFields
mDBLinkCmpRW.OpenView("OE0520", OEORD1header)
OEORD1headerFields = OEORD1header.Fields
Dim OEORD1detail1 As AccpacCOMAPI.AccpacView
Dim OEORD1detail1Fields As AccpacCOMAPI.AccpacViewFields
mDBLinkCmpRW.OpenView("OE0500", OEORD1detail1)
OEORD1detail1Fields = OEORD1detail1.Fields
Dim OEORD1detail2 As AccpacCOMAPI.AccpacView
Dim OEORD1detail2Fields As AccpacCOMAPI.AccpacViewFields
mDBLinkCmpRW.OpenView("OE0740", OEORD1detail2)
OEORD1detail2Fields = OEORD1detail2.Fields
Dim OEORD1detail3 As AccpacCOMAPI.AccpacView
Dim OEORD1detail3Fields As AccpacCOMAPI.AccpacViewFields
mDBLinkCmpRW.OpenView("OE0180", OEORD1detail3)
OEORD1detail3Fields = OEORD1detail3.Fields
Dim OEORD1detail4 As AccpacCOMAPI.AccpacView
Dim OEORD1detail4Fields As AccpacCOMAPI.AccpacViewFields
mDBLinkCmpRW.OpenView("OE0680", OEORD1detail4)
OEORD1detail4Fields = OEORD1detail4.Fields
Dim OEORD1detail5 As AccpacCOMAPI.AccpacView
Dim OEORD1detail5Fields As AccpacCOMAPI.AccpacViewFields
mDBLinkCmpRW.OpenView("OE0526", OEORD1detail5)
OEORD1detail5Fields = OEORD1detail5.Fields
Dim OEORD1detail6 As AccpacCOMAPI.AccpacView
Dim OEORD1detail6Fields As AccpacCOMAPI.AccpacViewFields
mDBLinkCmpRW.OpenView("OE0522", OEORD1detail6)
OEORD1detail6Fields = OEORD1detail6.Fields
Dim OEORD1detail7 As AccpacCOMAPI.AccpacView
Dim OEORD1detail7Fields As AccpacCOMAPI.AccpacViewFields
mDBLinkCmpRW.OpenView("OE0501", OEORD1detail7)
OEORD1detail7Fields = OEORD1detail7.Fields
Dim OEORD1detail8 As AccpacCOMAPI.AccpacView
Dim OEORD1detail8Fields As AccpacCOMAPI.AccpacViewFields
mDBLinkCmpRW.OpenView("OE0502", OEORD1detail8)
OEORD1detail8Fields = OEORD1detail8.Fields
Dim OEORD1detail9 As AccpacCOMAPI.AccpacView
Dim OEORD1detail9Fields As AccpacCOMAPI.AccpacViewFields
mDBLinkCmpRW.OpenView("OE0504", OEORD1detail9)
OEORD1detail9Fields = OEORD1detail9.Fields
Dim OEORD1detail10 As AccpacCOMAPI.AccpacView
Dim OEORD1detail10Fields As AccpacCOMAPI.AccpacViewFields
mDBLinkCmpRW.OpenView("OE0503", OEORD1detail10)
OEORD1detail10Fields = OEORD1detail10.Fields
OEORD1header.Compose(Array(OEORD1detail1, OEORD1detail4, OEORD1detail3, OEORD1detail2, OEORD1detail5, OEORD1detail6))
OEORD1detail1.Compose(Array(OEORD1header, OEORD1detail7, OEORD1detail10, OEORD1detail8))
OEORD1detail2.Compose(Array(OEORD1header))
OEORD1detail3.Compose(Array(OEORD1header, OEORD1detail1))
OEORD1detail4.Compose(Array(OEORD1header, OEORD1detail1))
OEORD1detail5.Compose(Array(OEORD1header))
OEORD1detail6.Compose(Array(OEORD1header))
OEORD1detail7.Compose(Array(OEORD1detail1))
OEORD1detail8.Compose(Array(OEORD1detail1, OEORD1detail9))
OEORD1detail9.Compose(Array(OEORD1detail8))
OEORD1detail10.Compose(Array(OEORD1detail1))
OEORD1headerFields("DRIVENBYUI").Value = "1" ' Driven by UI
OEORD1detail1Fields("DRIVENBYUI").Value = "1" ' Driven by UI
OEORD1header.Cancel()
OEORD1header.Cancel()
temp = OEORD1header.Exists
OEORD1header.Init()
OEORD1detail2.Browse("", 1)
OEORD1detail2.Fetch()
OEORD1headerFields("CUSTOMER").Value = "AIR001" ' Customer Number
OEORD1detail2.Browse("", 1)
OEORD1detail2Fields("PAYMENT").PutWithoutVerification("-32767") ' Payment Number
OEORD1detail2.Browse("", -1)
OEORD1detail2.Fetch()
OEORD1headerFields("PROCESSCMD").PutWithoutVerification("1") ' Process OIP Command
OEORD1header.Process()
OEORD1headerFields("CUSTOMER").Value = "BAK001" ' Customer Number
OEORD1detail2.Browse("", 1)
OEORD1detail2Fields("PAYMENT").PutWithoutVerification("-32767") ' Payment Number
OEORD1detail2.Browse("", -1)
OEORD1detail2.Fetch()
OEORD1headerFields("PROCESSCMD").PutWithoutVerification("1") ' Process OIP Command
OEORD1header.Process()
OEORD1headerFields("TEMPLATE").Value = "DEF" ' Template Code
OEORD1detail2.Browse("", 1)
OEORD1detail2Fields("PAYMENT").PutWithoutVerification("-32767") ' Payment Number
OEORD1detail2.Browse("", -1)
OEORD1detail2.Fetch()
temp = OEORD1header.Exists
OEORD1headerFields("GOCALCTAX").PutWithoutVerification("1") ' Perform Tax Calculation
OEORD1header.Process()
OEORD1headerFields("PONUMBER").Value = "P012345" ' Purchase Order Number
temp = OEORD1detail1.Exists
OEORD1detail1.RecordClear()
temp = OEORD1detail1.Exists
OEORD1detail1.RecordCreate(0)
OEORD1detail1Fields("ITEM").Value = "1000" ' Item
OEORD1detail1Fields("PROCESSCMD").PutWithoutVerification("1") ' Process Command
OEORD1detail1.Process()
OEORD1detail1Fields("DESC").Value = "Consulting Accpac123" ' Description
OEORD1detail1Fields("QTYORDERED").Value = "1.0000" ' Quantity Ordered
OEORD1detail1.Insert()
OEORD1detail1Fields("LINENUM").PutWithoutVerification("-1") ' Line Number
OEORD1detail1.Read()
temp = OEORD1detail1.Exists
OEORD1detail1.RecordCreate(0)
OEORD1detail1Fields("LINENUM").PutWithoutVerification("-1") ' Line Number
OEORD1detail1.Read()
temp = OEORD1detail1.Exists
OEORD1detail1.RecordCreate(0)
OEORD1detail1Fields("ITEM").Value = "1100" ' Item
OEORD1detail1Fields("PROCESSCMD").PutWithoutVerification("1") ' Process Command
OEORD1detail1.Process()
OEORD1detail1Fields("QTYORDERED").Value = "60.0000" ' Quantity Ordered
OEORD1detail1.Insert()
OEORD1detail1Fields("LINENUM").PutWithoutVerification("-3") ' Line Number
OEORD1detail1.Read()
OEORD1headerFields("OECOMMAND").Value = "4" ' Process O/E Command
OEORD1header.Process()
OEORD1header.Insert()
OEORD1header.Order = 1
OEORD1header.Read()
OEORD1header.Order = 0
OEORD1detail1Fields("LINENUM").PutWithoutVerification("-32767") ' Line Number
OEORD1detail1.Browse("", 1)
OEORD1detail1.Fetch()
OEORD1detail8Fields("PRNCOMPNUM").PutWithoutVerification("-2147483647") ' Parent Component Number
OEORD1detail8Fields("COMPNUM").PutWithoutVerification("-2147483647") ' Component Number
OEORD1detail8.Browse("", 1)
OEORD1detail8.Fetch()
OEORD1detail4Fields("UNIQUIFIER").PutWithoutVerification("-32767") ' Uniquifier
OEORD1detail4.Browse("", 1)
OEORD1detail4.Fetch()
OEORD1detail3Fields("UNIQUIFIER").PutWithoutVerification("-32767") ' Uniquifier
OEORD1detail3.Browse("", 1)
OEORD1detail3.Fetch()
OEORD1detail2Fields("PAYMENT").PutWithoutVerification("-32767") ' Payment Number
OEORD1detail2.Browse("", -1)
OEORD1detail2.Fetch()
OEORD1detail2Fields("PAYMENT").PutWithoutVerification("-3") ' Payment Number
OEORD1detail2.Browse("", 1)
OEORD1detail2Fields("PAYMENT").PutWithoutVerification("-32767") ' Payment Number
OEORD1detail2.Browse("", -1)
OEORD1detail2.Fetch()
temp = OEORD1header.Exists
OEORD1headerFields("GOSHIPALL").Value = "1" ' Perform Ship All
OEORD1header.Process()
OEORD1headerFields("OECOMMAND").Value = "4" ' Process O/E Command
OEORD1header.Process()
temp = OEORD1header.Exists
OEORD1header.Update()
OEORD1header.Order = 1
OEORD1header.Read()
OEORD1header.Order = 0
OEORD1detail1Fields("LINENUM").PutWithoutVerification("-32767") ' Line Number
OEORD1detail1.Browse("", 1)
OEORD1detail1.Fetch()
OEORD1detail8Fields("PRNCOMPNUM").PutWithoutVerification("-2147483647") ' Parent Component Number
OEORD1detail8Fields("COMPNUM").PutWithoutVerification("-2147483647") ' Component Number
OEORD1detail8.Browse("", 1)
OEORD1detail8.Fetch()
OEORD1detail4Fields("UNIQUIFIER").PutWithoutVerification("-32767") ' Uniquifier
OEORD1detail4.Browse("", 1)
OEORD1detail4.Fetch()
OEORD1detail3Fields("UNIQUIFIER").PutWithoutVerification("-32767") ' Uniquifier
OEORD1detail3.Browse("", 1)
OEORD1detail3.Fetch()
OEORD1detail2Fields("PAYMENT").PutWithoutVerification("-32767") ' Payment Number
OEORD1detail2.Browse("", -1)
OEORD1detail2.Fetch()
OEORD1detail2.Browse("", 1)
OEORD1detail2Fields("PAYMENT").PutWithoutVerification("-32767") ' Payment Number
OEORD1detail2.Browse("", -1)
OEORD1detail2.Fetch()
temp = OEORD1header.Exists
OEORD1header.Order = 1
OEORD1header.Read()
OEORD1header.Order = 0
OEORD1detail1Fields("LINENUM").PutWithoutVerification("-32767") ' Line Number
OEORD1detail1.Browse("", 1)
OEORD1detail1.Fetch()
OEORD1detail8Fields("PRNCOMPNUM").PutWithoutVerification("-2147483647") ' Parent Component Number
OEORD1detail8Fields("COMPNUM").PutWithoutVerification("-2147483647") ' Component Number
OEORD1detail8.Browse("", 1)
OEORD1detail8.Fetch()
OEORD1detail4Fields("UNIQUIFIER").PutWithoutVerification("-32767") ' Uniquifier
OEORD1detail4.Browse("", 1)
OEORD1detail4.Fetch()
OEORD1detail3Fields("UNIQUIFIER").PutWithoutVerification("-32767") ' Uniquifier
OEORD1detail3.Browse("", 1)
OEORD1detail3.Fetch()
OEORD1detail2Fields("PAYMENT").PutWithoutVerification("-32767") ' Payment Number
OEORD1detail2.Browse("", -1)
OEORD1detail2.Fetch()
OEORD1detail2.Browse("", 1)
OEORD1detail2Fields("PAYMENT").PutWithoutVerification("-32767") ' Payment Number
OEORD1detail2.Browse("", -1)
OEORD1detail2.Fetch()
temp = OEORD1header.Exists
Exit Sub
ACCPACErrorHandler:
Dim lCount As Long
Dim lIndex As Long
If Errors Is Nothing Then
MsgBox(Err.Description)
Else
lCount = Errors.Count
If lCount = 0 Then
MsgBox(Err.Description)
Else
For lIndex = 0 To lCount - 1
MsgBox(Errors.Item(lIndex))
Next
Errors.Clear()
End If
Resume Next
End If