G
Guest
Private Sub cmdDataLoadAllStreams_Click()
If DLookup("[frm_002_DataLoadAll]", "qry_SY_0200_sel_User_Access_Level") =
"-1" Then
''Check to ensure EMT is not currently Loading Data - when EMT is loading
''data, it populates "tbl_SY_0006_System_Process_Status" with a comment
''of "Load"
If DLookup("[SystemProcessStatus]", "tbl_SY_0006_System_Process_Status") =
"Load" Then
MsgBox "EMT is currently Loading Data", vbOKOnly, "EMT: Data Load Information"
Exit Sub
Else
''Check to ensure EMT is not currently Loading Data - when EMT is
''generating exceptions, it populates "tbl_SY_0006_System_Process_Status"
''with a comment of "Exception"
If DLookup("[SystemProcessStatus]", "tbl_SY_0006_System_Process_Status") =
"Exception" Then
MsgBox "EMT is currently Generating Exceptions", vbOKOnly, "EMT: Data Load
Information"
Exit Sub
Else
''Check to ensure that all NE reports have been loaded for the previous 7 days
If DLookup("[NE]", "qry_IB_0014_sel_ImportControl_Totals") <> 7 Then
MsgBox "One or more NE Reports are missing for the previous week", vbOKOnly,
"EMT: Data Load Error"
Exit Sub
Else
''Check to ensure that all CD reports have been loaded for the previous 7 days
If DLookup("[CD]", "qry_IB_0014_sel_ImportControl_Totals") <> 7 Then
MsgBox "One or more CD Reports are missing for the previous week", vbOKOnly,
"EMT: Data Load Error"
Exit Sub
Else
''Check to ensure that all RAT reports have been loaded for the previous 7
days
If DLookup("[RAT]", "qry_IB_0014_sel_ImportControl_Totals") <> 7 Then
MsgBox "One or more RAT Reports are missing for the previous week",
vbOKOnly, "EMT: Data Load Error"
Exit Sub
Else
''Check to ensure that all AFG reports have been loaded for the previous 7
days
If DLookup("[AFG]", "qry_IB_0014_sel_ImportControl_Totals") <> 7 Then
MsgBox "One or more AFG Reports are missing for the previous week",
vbOKOnly, "EMT: Data Load Error"
Exit Sub
Else
''Check to ensure that all AMR reports have been loaded for the previous 7
days
If DLookup("[AMR]", "qry_IB_0014_sel_ImportControl_Totals") <> 7 Then
MsgBox "One or more AMR Reports are missing for the previous week",
vbOKOnly, "EMT: Data Load Error"
Exit Sub
Else
''Check to ensure that all DC reports have been loaded for the previous 7 days
If DLookup("[DC]", "qry_IB_0014_sel_ImportControl_Totals") <> 7 Then
MsgBox "One or more DC Reports are missing for the previous week", vbOKOnly,
"EMT: Data Load Error"
Exit Sub
Else
''Check to ensure that all DP reports have been loaded for the previous 7 days
If DLookup("[DP]", "qry_IB_0014_sel_ImportControl_Totals") <> 7 Then
MsgBox "One or more DP Reports are missing for the previous week", vbOKOnly,
"EMT: Data Load Error"
Exit Sub
Else
''Check to ensure that all DF reports have been loaded for the previous 7 days
If DLookup("[DF]", "qry_IB_0014_sel_ImportControl_Totals") <> 7 Then
MsgBox "One or more DF Reports are missing for the previous week", vbOKOnly,
"EMT: Data Load Error"
Exit Sub
Else
''Check to ensure that the GGN Summary Table has been created for the
previous day's reconciliation
If DLookup("[GGN]", "qry_IB_0015_ctb_SQL_Summary_MaxDate") <>
FormatDateTime((Now() - 1), vbShortDate) Then
MsgBox "The GPRS (GCDR) Summary Table has not been updated to include
yesterday's data", vbOKOnly, "EMT: Data Load Error"
Exit Sub
Else
''Check to ensure that the GRO Summary Table has been created for the
previous day's reconciliation
''If DLookup("[GRO]", "qry_IB_0015_ctb_SQL_Summary_MaxDate") <>
FormatDateTime((Now() - 1), vbShortDate) Then
''MsgBox "The Grouse SMS Summary Table has not been updated to include
yesterday's data", vbOKOnly, "EMT: Data Load Error"
''Exit Sub
''Else
''Check to ensure that the MSC Summary Table has been created for the
previous day's reconciliation
If DLookup("[MSC]", "qry_IB_0015_ctb_SQL_Summary_MaxDate") <>
FormatDateTime((Now() - 1), vbShortDate) Then
MsgBox "The 2G Voice Summary Table has not been updated to include
yesterday's data", vbOKOnly, "EMT: Data Load Error"
Exit Sub
Else
''Check to ensure that the ORC Summary Table has been created for the
previous day's reconciliation
If DLookup("[ORC]", "qry_IB_0015_ctb_SQL_Summary_MaxDate") <>
FormatDateTime((Now() - 1), vbShortDate) Then
MsgBox "The ORCA Summary Table has not been updated to include yesterday's
data", vbOKOnly, "EMT: Data Load Error"
Exit Sub
Else
''Check to ensure that the SMS Summary Table has been created for the
previous day's reconciliation
''If DLookup("[SMS]", "qry_IB_0015_ctb_SQL_Summary_MaxDate") <>
FormatDateTime((Now() - 1), vbShortDate) Then
''MsgBox "The CMG SMS Summary Table has not been updated to include
yesterday's data", vbOKOnly, "EMT: Data Load Error"
''Exit Sub
''Else
''Check to ensure that the T3G Summary Table has been created for the
previous day's reconciliation
If DLookup("[T3G]", "qry_IB_0015_ctb_SQL_Summary_MaxDate") <>
FormatDateTime((Now() - 1), vbShortDate) Then
MsgBox "The 3G Voice Summary Table has not been updated to include
yesterday's data", vbOKOnly, "EMT: Data Load Error"
Exit Sub
Else
''Run Data Load Process
DoCmd.SetWarnings False
DoCmd.OpenQuery "qry_SY_0001_app_System_Process_Status_1"
DoCmd.OpenQuery "qry_SY_0100_app_Audit_Load_Start"
DoCmd.RunMacro "mcr_AA_Import_Data"
DoCmd.OpenQuery "qry_SY_0101_upd_Audit_Load_End"
DoCmd.OpenQuery "qry_SY_0003_del_System_Process_Status"
DoCmd.SetWarnings True
Me.SetFocus
Me.Refresh
MsgBox "Data Load Successful", vbOKOnly, "EMT: Data Load Information"
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
''End If
''End If
Else
MsgBox "Access Unavailable" & vbCrLf & "Please contact an EMT
Administrator if Access to this module is required", vbOKOnly, "EMT: Access
Error"
Exit Sub
End If
End Sub
If DLookup("[frm_002_DataLoadAll]", "qry_SY_0200_sel_User_Access_Level") =
"-1" Then
''Check to ensure EMT is not currently Loading Data - when EMT is loading
''data, it populates "tbl_SY_0006_System_Process_Status" with a comment
''of "Load"
If DLookup("[SystemProcessStatus]", "tbl_SY_0006_System_Process_Status") =
"Load" Then
MsgBox "EMT is currently Loading Data", vbOKOnly, "EMT: Data Load Information"
Exit Sub
Else
''Check to ensure EMT is not currently Loading Data - when EMT is
''generating exceptions, it populates "tbl_SY_0006_System_Process_Status"
''with a comment of "Exception"
If DLookup("[SystemProcessStatus]", "tbl_SY_0006_System_Process_Status") =
"Exception" Then
MsgBox "EMT is currently Generating Exceptions", vbOKOnly, "EMT: Data Load
Information"
Exit Sub
Else
''Check to ensure that all NE reports have been loaded for the previous 7 days
If DLookup("[NE]", "qry_IB_0014_sel_ImportControl_Totals") <> 7 Then
MsgBox "One or more NE Reports are missing for the previous week", vbOKOnly,
"EMT: Data Load Error"
Exit Sub
Else
''Check to ensure that all CD reports have been loaded for the previous 7 days
If DLookup("[CD]", "qry_IB_0014_sel_ImportControl_Totals") <> 7 Then
MsgBox "One or more CD Reports are missing for the previous week", vbOKOnly,
"EMT: Data Load Error"
Exit Sub
Else
''Check to ensure that all RAT reports have been loaded for the previous 7
days
If DLookup("[RAT]", "qry_IB_0014_sel_ImportControl_Totals") <> 7 Then
MsgBox "One or more RAT Reports are missing for the previous week",
vbOKOnly, "EMT: Data Load Error"
Exit Sub
Else
''Check to ensure that all AFG reports have been loaded for the previous 7
days
If DLookup("[AFG]", "qry_IB_0014_sel_ImportControl_Totals") <> 7 Then
MsgBox "One or more AFG Reports are missing for the previous week",
vbOKOnly, "EMT: Data Load Error"
Exit Sub
Else
''Check to ensure that all AMR reports have been loaded for the previous 7
days
If DLookup("[AMR]", "qry_IB_0014_sel_ImportControl_Totals") <> 7 Then
MsgBox "One or more AMR Reports are missing for the previous week",
vbOKOnly, "EMT: Data Load Error"
Exit Sub
Else
''Check to ensure that all DC reports have been loaded for the previous 7 days
If DLookup("[DC]", "qry_IB_0014_sel_ImportControl_Totals") <> 7 Then
MsgBox "One or more DC Reports are missing for the previous week", vbOKOnly,
"EMT: Data Load Error"
Exit Sub
Else
''Check to ensure that all DP reports have been loaded for the previous 7 days
If DLookup("[DP]", "qry_IB_0014_sel_ImportControl_Totals") <> 7 Then
MsgBox "One or more DP Reports are missing for the previous week", vbOKOnly,
"EMT: Data Load Error"
Exit Sub
Else
''Check to ensure that all DF reports have been loaded for the previous 7 days
If DLookup("[DF]", "qry_IB_0014_sel_ImportControl_Totals") <> 7 Then
MsgBox "One or more DF Reports are missing for the previous week", vbOKOnly,
"EMT: Data Load Error"
Exit Sub
Else
''Check to ensure that the GGN Summary Table has been created for the
previous day's reconciliation
If DLookup("[GGN]", "qry_IB_0015_ctb_SQL_Summary_MaxDate") <>
FormatDateTime((Now() - 1), vbShortDate) Then
MsgBox "The GPRS (GCDR) Summary Table has not been updated to include
yesterday's data", vbOKOnly, "EMT: Data Load Error"
Exit Sub
Else
''Check to ensure that the GRO Summary Table has been created for the
previous day's reconciliation
''If DLookup("[GRO]", "qry_IB_0015_ctb_SQL_Summary_MaxDate") <>
FormatDateTime((Now() - 1), vbShortDate) Then
''MsgBox "The Grouse SMS Summary Table has not been updated to include
yesterday's data", vbOKOnly, "EMT: Data Load Error"
''Exit Sub
''Else
''Check to ensure that the MSC Summary Table has been created for the
previous day's reconciliation
If DLookup("[MSC]", "qry_IB_0015_ctb_SQL_Summary_MaxDate") <>
FormatDateTime((Now() - 1), vbShortDate) Then
MsgBox "The 2G Voice Summary Table has not been updated to include
yesterday's data", vbOKOnly, "EMT: Data Load Error"
Exit Sub
Else
''Check to ensure that the ORC Summary Table has been created for the
previous day's reconciliation
If DLookup("[ORC]", "qry_IB_0015_ctb_SQL_Summary_MaxDate") <>
FormatDateTime((Now() - 1), vbShortDate) Then
MsgBox "The ORCA Summary Table has not been updated to include yesterday's
data", vbOKOnly, "EMT: Data Load Error"
Exit Sub
Else
''Check to ensure that the SMS Summary Table has been created for the
previous day's reconciliation
''If DLookup("[SMS]", "qry_IB_0015_ctb_SQL_Summary_MaxDate") <>
FormatDateTime((Now() - 1), vbShortDate) Then
''MsgBox "The CMG SMS Summary Table has not been updated to include
yesterday's data", vbOKOnly, "EMT: Data Load Error"
''Exit Sub
''Else
''Check to ensure that the T3G Summary Table has been created for the
previous day's reconciliation
If DLookup("[T3G]", "qry_IB_0015_ctb_SQL_Summary_MaxDate") <>
FormatDateTime((Now() - 1), vbShortDate) Then
MsgBox "The 3G Voice Summary Table has not been updated to include
yesterday's data", vbOKOnly, "EMT: Data Load Error"
Exit Sub
Else
''Run Data Load Process
DoCmd.SetWarnings False
DoCmd.OpenQuery "qry_SY_0001_app_System_Process_Status_1"
DoCmd.OpenQuery "qry_SY_0100_app_Audit_Load_Start"
DoCmd.RunMacro "mcr_AA_Import_Data"
DoCmd.OpenQuery "qry_SY_0101_upd_Audit_Load_End"
DoCmd.OpenQuery "qry_SY_0003_del_System_Process_Status"
DoCmd.SetWarnings True
Me.SetFocus
Me.Refresh
MsgBox "Data Load Successful", vbOKOnly, "EMT: Data Load Information"
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
''End If
''End If
Else
MsgBox "Access Unavailable" & vbCrLf & "Please contact an EMT
Administrator if Access to this module is required", vbOKOnly, "EMT: Access
Error"
Exit Sub
End If
End Sub