Dim mDBLinkCmpRW As AccpacCOMAPI.AccpacDBLink
Set mDBLinkCmpRW = OpenDBLink(DBLINK_COMPANY, DBLINK_FLG_READWRITE)
Dim OEORD1header As AccpacCOMAPI.AccpacView
mDBLinkCmpRW.OpenView "OE0520", OEORD1header
Dim OEORD1detail1 As AccpacCOMAPI.AccpacView
mDBLinkCmpRW.OpenView "OE0500", OEORD1detail1
Dim OEORD1detail2 As AccpacCOMAPI.AccpacView
mDBLinkCmpRW.OpenView "OE0740", OEORD1detail2
Dim OEORD1detail3 As AccpacCOMAPI.AccpacView
mDBLinkCmpRW.OpenView "OE0180", OEORD1detail3
Dim OEORD1detail4 As AccpacCOMAPI.AccpacView
mDBLinkCmpRW.OpenView "OE0680", OEORD1detail4
Dim OEORD1detail5 As AccpacCOMAPI.AccpacView
mDBLinkCmpRW.OpenView "OE0526", OEORD1detail5
Dim OEORD1detail6 As AccpacCOMAPI.AccpacView
mDBLinkCmpRW.OpenView "OE0522", OEORD1detail6
Dim OEORD1detail7 As AccpacCOMAPI.AccpacView
mDBLinkCmpRW.OpenView "OE0501", OEORD1detail7
Dim OEORD1detail8 As AccpacCOMAPI.AccpacView
mDBLinkCmpRW.OpenView "OE0502", OEORD1detail8
Dim OEORD1detail9 As AccpacCOMAPI.AccpacView
mDBLinkCmpRW.OpenView "OE0504", OEORD1detail9
Dim OEORD1detail10 As AccpacCOMAPI.AccpacView
mDBLinkCmpRW.OpenView "OE0503", OEORD1detail10
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)
OEORD1header.Browse "{Insert your criteria here}", True
Do While OEORD1header.Fetch
OEORD1header.Delete
Loop