Function fDailyBatch()
On Error GoTo fDailyBatch_Err
Dim db As Database
Dim TD1 As TableDef
Dim QD1 As QueryDef
Dim RS1 As Recordset
Set db = CurrentDb()
Set TD1 = db.TableDefs!tblLogBatchRuns
Set RS1 = TD1.OpenRecordset
RS1.AddNew
RS1!RunStartTime = Now()
RS1!Process = "Daily"
DoCmd.SetWarnings False
'Forms!frmRunBatch!txtStepName = "1. Delete NotesDownload"
DoCmd.OpenQuery "qDeleteNotesDownload", acNormal, acEdit
'Forms!frmRunBatch!txtStepName = "2. Import Notes text file"
DoCmd.TransferText acImportDelim, "ERCfile Import Specification", "dbo_NotesDownload", "C:\Hartman\ERC\ERCfile.txt", False, ""
'Forms!frmRunBatch!txtStepName = "3. Update people Ids in DWDownload"
DoCmd.OpenQuery "qUpdatePeopleIds", acNormal, acEdit
'Forms!frmRunBatch!txtStepName = "4. Add new rows to Cont/Exh"
DoCmd.OpenQuery "qJoinNotesToDWAppendContExh", acNormal, acEdit
'Forms!frmRunBatch!txtStepName = "5. Delete CIS Company"
DoCmd.OpenQuery "qDeleteCISCompany", acNormal, acEdit
'Forms!frmRunBatch!txtStepName = "6. Append CIS Company"
DoCmd.OpenQuery "qAppendCISCompany", acNormal, acEdit
'Forms!frmRunBatch!txtStepName = "7. Add new rows to LOB Group"
DoCmd.OpenQuery "qJoinNotesToDWAppendLOBGroup", acNormal, acEdit
'Forms!frmRunBatch!txtStepName = "8. Add new rows to LOB Detail"
DoCmd.OpenQuery "qJoinNotesToDWAppendLOBDetail", acNormal, acEdit
'Forms!frmRunBatch!txtStepName = "9. Delete email ToDo"
DoCmd.OpenQuery "qDeleteToDo", acNormal, acEdit
'Forms!frmRunBatch!txtStepName = "10. Rebuild email ToDo"
DoCmd.OpenQuery "qExtractToDo", acNormal, acEdit
DoCmd.SetWarnings True
fDailyBatch_Exit:
RS1!RunEndTime = Now()
RS1.Update
Exit Function
fDailyBatch_Err:
'MsgBox Err.Number & " - " & Err.Description
RS1!ErrNum = Err.Number
RS1!errDesc = Err.Description
Resume fDailyBatch_Exit
End Function