Option Compare Database Option Explicit '------------------------------------------------------------ ' Open_IMF2 ' ' DESC: This function opens the IMF2.txt file and imports it into ' the IMF2 table. It also creates a creation log of data in the ' CREATION_LOG_IMF table for each record that is imported or attempted ' to import. ' ' INPUT: IMF2.txt ' OUTPUTS: IMF2 table, CREATION_LOG_IMF table ' ' Written by Shawn McKenna '------------------------------------------------------------ Function Open_IMF2() On Error GoTo ErrorHandler Dim dbIMF2 As Database Dim rcdIMF, rcdIMFCL As Recordset Dim QoH, SR, SL, EC Dim Prod_Num As Long Dim Prod_Group, Store_ID, EOQ, intGood, intBad As Integer Dim Prod_Desc, UoM As String Dim CPU As Currency Dim LT As Single Set dbIMF2 = CurrentDb() Set rcdIMF = dbIMF2.OpenRecordset("IMF2") Set rcdIMFCL = dbIMF2.OpenRecordset("CREATION_LOG_IMF") intGood = 0 ' this is the counter for good records intBad = 0 ' this is the counter for bad records Open "C:\IMF2.txt" For Input As #1 ' Open file for input. Do While Not EOF(1) ' Loop until end of file. Input #1, Prod_Num, Prod_Group, Prod_Desc, UoM, CPU, Store_ID, QoH, LT, _ EOQ, SR, SL, EC ' Read data into two variables. ' These statements add a record from a txt file to a record in the IMF2 table rcdIMF.AddNew rcdIMF![Product_Num] = Prod_Num rcdIMF![Product_Group] = Prod_Group rcdIMF![Product_Desc] = Prod_Desc rcdIMF![Unit_of_Measure] = UoM rcdIMF![Cost_per_Unit] = CPU rcdIMF![Store_ID] = Store_ID rcdIMF![Qty_on_Hand] = QoH rcdIMF![Leadtime] = LT rcdIMF![Econ_Order_Quantity] = EOQ rcdIMF![Sales_Rate] = SR rcdIMF![Safety_Level] = SL rcdIMF![Exception_Code] = EC rcdIMF.Update intGood = intGood + 1 ' The following statements add the fields to a CREATION_LOG_IMF table rcdIMFCL.AddNew rcdIMFCL![Product_Num] = Prod_Num rcdIMFCL![Product_Group] = Prod_Group rcdIMFCL![Product_Desc] = Prod_Desc rcdIMFCL![Unit_of_Measure] = UoM rcdIMFCL![Cost_per_Unit] = CPU rcdIMFCL![Store_ID] = Store_ID rcdIMFCL![Qty_on_Hand] = QoH rcdIMFCL![Leadtime] = LT rcdIMFCL![Econ_Order_Quantity] = EOQ rcdIMFCL![Sales_Rate] = SR rcdIMFCL![Safety_Level] = SL rcdIMFCL![Exception_Code] = EC rcdIMFCL![Import_Date] = Date rcdIMFCL![Import_Time] = Time rcdIMFCL![Status] = "Success" rcdIMFCL.Update Continue_Again: Loop Close #1 ' Close file. MsgBox "IMF2.txt into IMF2 table." & _ "@" & intGood & " records were successfully imported." & _ "@" & intBad & " records were not successfully imported. ", _ vbExclamation, "Import Results" Macro11_Exit: Exit Function ErrorHandler: ' Display error information. If Err.Number = 53 Then MsgBox Error$ Exit Function Else rcdIMFCL.AddNew rcdIMFCL![Product_Num] = Prod_Num rcdIMFCL![Product_Group] = Prod_Group rcdIMFCL![Product_Desc] = Prod_Desc rcdIMFCL![Unit_of_Measure] = UoM rcdIMFCL![Cost_per_Unit] = CPU rcdIMFCL![Store_ID] = Store_ID rcdIMFCL![Qty_on_Hand] = QoH rcdIMFCL![Leadtime] = LT rcdIMFCL![Econ_Order_Quantity] = EOQ rcdIMFCL![Sales_Rate] = SR rcdIMFCL![Safety_Level] = SL rcdIMFCL![Exception_Code] = EC rcdIMFCL![Import_Date] = Date rcdIMFCL![Import_Time] = Time rcdIMFCL![Status] = Err.Number rcdIMFCL.Update intBad = intBad + 1 ' Resume with statement following occurrence of error. End If Resume Continue_Again: 'This skips the success statements for the creation log. End Function '------------------------------------------------------------ ' Open_OCO ' ' DESC: This function opens the Open_Customer_Order.txt file and imports it into ' the Open_Customer_Order table. It also creates a creation log of data in the ' CREATION_LOG_OCO table for each record that is imported or attempted ' to import. ' ' INPUT: Open_Customer_Order.txt ' OUTPUTS: Open_Customer_Order table, CREATION_LOG_OCO table ' ' Written by '------------------------------------------------------------ Function Open_OCO() On Error GoTo ErrorHandler Dim dbOCO As Database Dim rcdOCO, rcdOCOCL As Recordset Dim CO_Num Dim Cu_ID As Long Dim CO_Date As Date Dim CO_Source, intGood, intBad As Integer Dim SP_ID As Long Dim CL_ID Set dbOCO = CurrentDb() Set rcdOCO = dbOCO.OpenRecordset("Open_Customer_Order") Set rcdOCOCL = dbOCO.OpenRecordset("CREATION_LOG_OCO") intGood = 0 'this initializes intGood intBad = 0 Open "C:\Open_Customer_Order.txt" For Input As #1 ' Open file for input. Do While Not EOF(1) ' Loop until end of file. Input #1, CO_Num, Cu_ID, CO_Date, CO_Source, SP_ID, CL_ID ' These statements add a record from a txt file to a record in the OCO table rcdOCO.AddNew rcdOCO![Customer_Order_Num] = CO_Num rcdOCO![Customer_ID] = Cu_ID rcdOCO![CO_Date_&_Time] = CO_Date rcdOCO![CO_Store_Source] = CO_Source rcdOCO![Salesperson_ID] = SP_ID rcdOCO![Clerk_ID] = CL_ID rcdOCO.Update intGood = intGood = 1 ' this is the counter for good records. ' The following statements add the fields to a CREATION_LOG_OCO table rcdOCOCL.AddNew rcdOCOCL![Customer_Order_Num] = CO_Num rcdOCOCL![Customer_ID] = Cu_ID rcdOCOCL![CO_Date_&_Time] = CO_Date rcdOCOCL![CO_Store_Source] = CO_Source rcdOCOCL![Salesperson_ID] = SP_ID rcdOCOCL![Clerk_ID] = CL_ID rcdOCOCL![Import_Date] = Date rcdOCOCL![Import_Time] = Time rcdOCOCL![Status] = "Success" rcdOCOCL.Update Continue_Again: Loop Close #1 ' Close file. MsgBox "Open_Customer_Order.txt file into Open_Customer_Order table" & _ "@" & intGood & " records were successfully imported." & _ "@" & intBad & " records were not successfully imported. ", _ vbExclamation, "Import Results" Open_OCO_Exit: Exit Function ErrorHandler: ' Display error information. If Err.Number = 53 Then MsgBox Error$ Exit Function Else rcdOCOCL.AddNew rcdOCOCL![Customer_Order_Num] = CO_Num rcdOCOCL![Customer_ID] = Cu_ID rcdOCOCL![CO_Date_&_Time] = CO_Date rcdOCOCL![CO_Store_Source] = CO_Source rcdOCOCL![Salesperson_ID] = SP_ID rcdOCOCL![Clerk_ID] = CL_ID rcdOCOCL![Import_Date] = Date rcdOCOCL![Import_Time] = Time rcdOCOCL![Status] = Err.Number rcdOCOCL.Update intBad = intBad + 1 ' this is the counter for bad records ' Resume with statement following occurrence of error. End If Resume Continue_Again: 'This skips the success statements for the creation log. End Function '------------------------------------------------------------ ' Open_OCOP ' ' DESC: This function opens the Open_Customer_Order_Products.txt file and imports it into ' the Open_Customer_Order_Products table. It also creates a creation log of data in the ' CREATION_LOG_OCOP table for each record that is imported or attempted ' to import. ' ' INPUT: Open_Customer_Order_Products.txt ' OUTPUTS: Open_Customer_Order_Products table, CREATION_LOG_OCOP table ' ' Written by '------------------------------------------------------------ Function Open_OCOP() On Error GoTo ErrorHandler Dim dbOCOP As Database Dim rcdOCOP, rcdOCOPCL As Recordset Dim CO_Num As Long Dim Prod_Num As Long Dim Qty_Ordered As Long Dim Qty_Filled As Long Dim Transaction_Type As String Dim intGood, intBad As Integer ' these integers are used for good/bad counter intGood = 0 intBad = 0 Set dbOCOP = CurrentDb() Set rcdOCOP = dbOCOP.OpenRecordset("Open_Customer_Order_Products") Set rcdOCOPCL = dbOCOP.OpenRecordset("CREATION_LOG_OCOP") Open "C:\Open_Customer_Order_Products.txt" For Input As #1 ' Open file for input. Do While Not EOF(1) ' Loop until end of file. Input #1, CO_Num, Prod_Num, Qty_Ordered, Qty_Filled, Transaction_Type ' These statements add a record from a txt file to a record in the OCOP table rcdOCOP.AddNew rcdOCOP![Customer_Order_Num] = CO_Num rcdOCOP![Prod_ID] = Prod_Num rcdOCOP![Qty_Ordered] = Qty_Ordered rcdOCOP![Qty_Filled] = Null rcdOCOP![Transaction_Type] = Transaction_Type rcdOCOP.Update intGood = intGood + 1 ' The following statements add the fields to a CREATION_LOG_OCOP table rcdOCOPCL.AddNew rcdOCOPCL![Customer_Order_Num] = CO_Num rcdOCOPCL![Prod_ID] = Prod_Num rcdOCOPCL![Qty_Ordered] = Qty_Ordered rcdOCOPCL![Qty_Filled] = Null rcdOCOPCL![Transaction_Type] = Transaction_Type rcdOCOPCL![Import_Date] = Date rcdOCOPCL![Import_Time] = Time rcdOCOPCL![Status] = "Success" rcdOCOPCL.Update Continue_Again: Loop Close #1 ' Close file. MsgBox "Open_Customer_Order_Products.txt into Open_Customer_Order_Products table. " & _ "@" & intGood & " records were successfully imported." & _ "@" & intBad & " records were not successfully imported. ", _ vbExclamation, "Import Results" Open_OCOP_Exit: Exit Function ErrorHandler: ' Display error information. If Err.Number = 53 Then MsgBox Error$ Exit Function Else rcdOCOPCL.AddNew rcdOCOPCL![Customer_Order_Num] = CO_Num rcdOCOPCL![Prod_ID] = Prod_Num rcdOCOPCL![Qty_Ordered] = Qty_Ordered rcdOCOPCL![Qty_Filled] = Null rcdOCOPCL![Transaction_Type] = Transaction_Type rcdOCOPCL![Import_Date] = Date rcdOCOPCL![Import_Time] = Time rcdOCOPCL![Status] = Err.Number rcdOCOPCL.Update intBad = intBad + 1 ' the counter for the bad records. ' Resume with statement following occurrence of error. End If Resume Continue_Again: 'This skips the success statements for the creation log. End Function '------------------------------------------------------------ ' Open_OPO ' ' DESC: This function opens the Open_Purchase_Order.txt file and imports it into ' the Open_Purchase_Order table. It also creates a creation log of data in the ' CREATION_LOG_OPO table for each record that is imported or attempted ' to import. ' ' INPUT: Open_Purchase_Order.txt ' OUTPUTS: Open_Purchase_Order table, CREATION_LOG_OPO table ' ' Written by '------------------------------------------------------------ Function Open_OPO() On Error GoTo ErrorHandler Dim dbOPO As Database Dim rcdOPO, rcdOPOCL As Recordset Dim PO_Num Dim Ven_ID As Long Dim PO_Date As Date Dim PO_Dest As Integer Dim P_ID As Long Dim CL_ID Dim intGood, intBad As Integer ' these integers are used for good/bad counter intGood = 0 intBad = 0 Set dbOPO = CurrentDb() Set rcdOPO = dbOPO.OpenRecordset("Open_Purchase_Order") Set rcdOPOCL = dbOPO.OpenRecordset("CREATION_LOG_OPO") Open "C:\Open_Purchase_Order.txt" For Input As #1 ' Open file for input. Do While Not EOF(1) ' Loop until end of file. Input #1, PO_Num, Ven_ID, PO_Date, PO_Dest, P_ID, CL_ID ' These statements add a record from a txt file to a record in the OPO table rcdOPO.AddNew rcdOPO![Purchase_Order_Num] = PO_Num rcdOPO![Vendor_ID] = Ven_ID rcdOPO![PO_Date_and_Time] = PO_Date rcdOPO![PO_Store_Destination] = PO_Dest rcdOPO![Purchaser_ID] = P_ID rcdOPO![Clerk_ID] = CL_ID rcdOPO.Update intGood = intGood + 1 ' The following statements add the fields to a CREATION_LOG_OPO table rcdOPOCL.AddNew rcdOPOCL![Purchase_Order_Num] = PO_Num rcdOPOCL![Vendor_ID] = Ven_ID rcdOPOCL![PO_Date_and_Time] = PO_Date rcdOPOCL![PO_Store_Destination] = PO_Dest rcdOPOCL![Purchaser_ID] = P_ID rcdOPOCL![Clerk_ID] = CL_ID rcdOPOCL![Import_Date] = Date rcdOPOCL![Import_Time] = Time rcdOPOCL![Status] = "Success" rcdOPOCL.Update Continue_Again: Loop Close #1 ' Close file. MsgBox "Imported Open_Purchase_Order.txt file into Open_Purchase_Order table" & _ "@" & intGood & " records were successfully imported." & _ "@" & intBad & " records were not successfully imported. ", _ vbExclamation, "Import Results" Open_OPO_Exit: Exit Function ErrorHandler: ' Display error information. If Err.Number = 53 Then MsgBox Error$ Exit Function Else rcdOPOCL.AddNew rcdOPOCL![Purchase_Order_Num] = PO_Num rcdOPOCL![Vendor_ID] = Ven_ID rcdOPOCL![PO_Date_and_Time] = PO_Date rcdOPOCL![PO_Store_Destination] = PO_Dest rcdOPOCL![Purchaser_ID] = P_ID rcdOPOCL![Clerk_ID] = CL_ID rcdOPOCL![Import_Date] = Date rcdOPOCL![Import_Time] = Time rcdOPOCL![Status] = Err.Number rcdOPOCL.Update intBad = intBad + 1 ' the counter for the bad records. ' Resume with statement following occurrence of error. End If Resume Continue_Again: 'This skips the success statements for the creation log. End Function '------------------------------------------------------------ ' Open_OPOP ' ' DESC: This function opens the Open_Purchase_Order_Products.txt file and imports it into ' the Open_Purchase_Order_Products table. It also creates a creation log of data in the ' CREATION_LOG_OPOP table for each record that is imported or attempted ' to import. ' ' INPUT: Open_Purchase_Order_Products.txt ' OUTPUTS: Open_Purchase_Order_Products table, CREATION_LOG_OPOP table ' ' Written by '------------------------------------------------------------ Function Open_OPOP() On Error GoTo ErrorHandler Dim dbOPOP As Database Dim rcdOPOP, rcdOPOPCL As Recordset Dim PO_Num As Long Dim Prod_Num As Long Dim Qty_Ordered As Long Dim Qty_Filled As Long Dim Transaction_Type As String Dim intGood, intBad As Integer ' these integers are used for good/bad counter intGood = 0 intBad = 0 Set dbOPOP = CurrentDb() Set rcdOPOP = dbOPOP.OpenRecordset("Open_Purchase_Order_Products") Set rcdOPOPCL = dbOPOP.OpenRecordset("CREATION_LOG_OPOP") Open "C:\Open_Purchase_Order_Products.txt" For Input As #1 ' Open file for input. Do While Not EOF(1) ' Loop until end of file. Input #1, PO_Num, Prod_Num, Qty_Ordered, Qty_Filled, Transaction_Type ' These statements add a record from a txt file to a record in the OCOP table rcdOPOP.AddNew rcdOPOP![Purchase_Order_Num] = PO_Num rcdOPOP![Prod_Num] = Prod_Num rcdOPOP![Qty_Ordered] = Qty_Ordered rcdOPOP![Qty_Filled] = Null rcdOPOP![Transaction_Type] = Transaction_Type rcdOPOP.Update intGood = intGood + 1 ' The following statements add the fields to a CREATION_LOG_OCOP table rcdOPOPCL.AddNew rcdOPOPCL![Purchase_Order_Num] = PO_Num rcdOPOPCL![Prod_Num] = Prod_Num rcdOPOPCL![Qty_Ordered] = Qty_Ordered rcdOPOPCL![Qty_Filled] = Null rcdOPOPCL![Transaction_Type] = Transaction_Type rcdOPOPCL![Import_Date] = Date rcdOPOPCL![Import_Time] = Time rcdOPOPCL![Status] = "Success" rcdOPOPCL.Update Continue_Again: Loop Close #1 ' Close file. MsgBox "Imported Open_Purchase_Order_Products.txt into Open_Purchase_Order_Products table. " & _ "@" & intGood & " records were successfully imported." & _ "@" & intBad & " records were not successfully imported. ", _ vbExclamation, "Import Results" Open_OPOP_Exit: Exit Function ErrorHandler: ' Display error information. If Err.Number = 53 Then MsgBox Error$ Exit Function Else rcdOPOPCL.AddNew rcdOPOPCL![Purchase_Order_Num] = PO_Num rcdOPOPCL![Prod_Num] = Prod_Num rcdOPOPCL![Qty_Ordered] = Qty_Ordered rcdOPOPCL![Qty_Filled] = Null rcdOPOPCL![Transaction_Type] = Transaction_Type rcdOPOPCL![Import_Date] = Date rcdOPOPCL![Import_Time] = Time rcdOPOPCL![Status] = Err.Number rcdOPOPCL.Update intBad = intBad + 1 ' the counter for the bad records. ' Resume with statement following occurrence of error. End If Resume Continue_Again: 'This skips the success statements for the creation log. End Function '------------------------------------------------------------ ' Open_OTO ' ' DESC: This function opens the Open_Trans_Order.txt file and imports it into ' the Open_Trans_Order table. It also creates a creation log of data in the ' CREATION_LOG_OTO table for each record that is imported or attempted ' to import. ' ' INPUT: Open_Trans_Order.txt ' OUTPUTS: Open_Trans_Order table, CREATION_LOG_OTO table ' ' Written by '------------------------------------------------------------ Function Open_OTO() On Error GoTo ErrorHandler Dim dbOTO As Database Dim rcdOTO, rcdOTOCL As Recordset Dim TO_Num Dim TO_Origin As Integer Dim TO_Dest As Integer Dim TO_Date As Date Dim IC_ID Dim intGood, intBad As Integer ' these integers are used for good/bad counter intGood = 0 intBad = 0 Set dbOTO = CurrentDb() Set rcdOTO = dbOTO.OpenRecordset("Open_Trans_Order") Set rcdOTOCL = dbOTO.OpenRecordset("CREATION_LOG_OTO") Open "C:\Open_Trans_Order.txt" For Input As #1 ' Open file for input. Do While Not EOF(1) ' Loop until end of file. Input #1, TO_Num, TO_Origin, TO_Dest, TO_Date, IC_ID ' These statements add a record from a txt file to a record in the OTO table rcdOTO.AddNew rcdOTO![Trans_Order_Num] = TO_Num rcdOTO![TO_Origin] = TO_Origin rcdOTO![TO_Destination] = TO_Dest rcdOTO![TO_Date_and_Time] = TO_Date rcdOTO![Inv_Controller_ID] = IC_ID rcdOTO.Update intGood = intGood + 1 ' The following statements add the fields to a CREATION_LOG_OTO table rcdOTOCL.AddNew rcdOTOCL![Trans_Order_Num] = TO_Num rcdOTOCL![TO_Origin] = TO_Origin rcdOTOCL![TO_Destination] = TO_Dest rcdOTOCL![TO_Date_and_Time] = TO_Date rcdOTOCL![Inv_Controller_ID] = IC_ID rcdOTOCL![Import_Date] = Date rcdOTOCL![Import_Time] = Time rcdOTOCL![Status] = "Success" rcdOTOCL.Update Continue_Again: Loop Close #1 ' Close file. MsgBox "Imported Open_Trans_Order.txt file into Open_Trans_Order table" & _ "@" & intGood & " records were successfully imported." & _ "@" & intBad & " records were not successfully imported. ", _ vbExclamation, "Import Results" Open_OTO_Exit: Exit Function ErrorHandler: ' Display error information. If Err.Number = 53 Then 'if the file does not exist then MsgBox Error$ 'display error message and exit Exit Function Else rcdOTOCL.AddNew rcdOTOCL![Trans_Order_Num] = TO_Num rcdOTOCL![TO_Origin] = TO_Origin rcdOTOCL![TO_Destination] = TO_Dest rcdOTOCL![TO_Date_and_Time] = TO_Date rcdOTOCL![Inv_Controller_ID] = IC_ID rcdOTOCL![Import_Date] = Date rcdOTOCL![Import_Time] = Time rcdOTOCL![Status] = Err.Number rcdOTOCL.Update intBad = intBad + 1 ' the counter for the bad records. ' Resume with statement following occurrence of error. End If Resume Continue_Again: 'This skips the success statements for the creation log. End Function '------------------------------------------------------------ ' Open_OTOP ' ' DESC: This function opens the Open_Trans_Order_Products.txt file and imports it into ' the Open_Trans_Order_Products table. It also creates a creation log of data in the ' CREATION_LOG_OTOP table for each record that is imported or attempted ' to import. ' ' INPUT: Open_Trans_Order_Products.txt ' OUTPUTS: Open_Trans_Order_Products table, CREATION_LOG_OTOP table ' ' Written by '------------------------------------------------------------ Function Open_OTOP() On Error GoTo ErrorHandler Dim dbOTOP As Database Dim rcdOTOP, rcdOTOPCL As Recordset Dim TO_Num As Long Dim Prod_Num As Long Dim Qty_Ordered As Long Dim Qty_Filled As Long Dim Qty_Received As Long Dim Transaction_Type As String Dim intGood, intBad As Integer ' these integers are used for good/bad counter intGood = 0 intBad = 0 Set dbOTOP = CurrentDb() Set rcdOTOP = dbOTOP.OpenRecordset("Open_Trans_Order_Products") Set rcdOTOPCL = dbOTOP.OpenRecordset("CREATION_LOG_OTOP") Open "C:\Open_Trans_Order_Products.txt" For Input As #1 ' Open file for input. Do While Not EOF(1) ' Loop until end of file. Input #1, TO_Num, Prod_Num, Qty_Ordered, Qty_Filled, Qty_Received, Transaction_Type ' These statements add a record from a txt file to a record in the OCOP table rcdOTOP.AddNew rcdOTOP![Trans_Order_Num] = TO_Num rcdOTOP![Product_Num] = Prod_Num rcdOTOP![Qty_Ordered] = Qty_Ordered rcdOTOP![Qty_Filled] = Null rcdOTOP![Qty_Received] = Null rcdOTOP![Transaction_Type] = Transaction_Type rcdOTOP.Update intGood = intGood + 1 ' The following statements add the fields to a CREATION_LOG_OCOP table rcdOTOPCL.AddNew rcdOTOPCL![Trans_Order_Num] = TO_Num rcdOTOPCL![Product_Num] = Prod_Num rcdOTOPCL![Qty_Ordered] = Qty_Ordered rcdOTOPCL![Qty_Filled] = Null rcdOTOPCL![Qty_Received] = Null rcdOTOPCL![Transaction_Type] = Transaction_Type rcdOTOPCL![Import_Date] = Date rcdOTOPCL![Import_Time] = Time rcdOTOPCL![Status] = "Success" rcdOTOPCL.Update Continue_Again: Loop Close #1 ' Close file. MsgBox "Imported Open_Trans_Order_Products.txt into Open_Trans_Order_Products table. " & _ "@" & intGood & " records were successfully imported." & _ "@" & intBad & " records were not successfully imported. ", _ vbExclamation, "Import Results" Open_OTOP_Exit: Exit Function ErrorHandler: ' Display error information. If Err.Number = 53 Then MsgBox Error$ Exit Function Else rcdOTOPCL.AddNew rcdOTOPCL![Trans_Order_Num] = TO_Num rcdOTOPCL![Product_Num] = Prod_Num rcdOTOPCL![Qty_Ordered] = Qty_Ordered rcdOTOPCL![Qty_Filled] = Null rcdOTOPCL![Qty_Received] = Null rcdOTOPCL![Transaction_Type] = Transaction_Type rcdOTOPCL![Import_Date] = Date rcdOTOPCL![Import_Time] = Time rcdOTOPCL![Status] = Err.Number rcdOTOPCL.Update intBad = intBad + 1 ' the counter for the bad records. ' Resume with statement following occurrence of error. End If Resume Continue_Again: 'This skips the success statements for the creation log. End Function