I am sure there is a much better way of doing this - any ideas ?

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
 
G

Guest

One thing, open a record set, instead of running Dlook up every time to
retrieve another field

Dim MyDB as Dao.DataBase, MyRec As Dao.RecordSet , MyDate As Date

MyDate = FormatDateTime((Now() - 1), vbShortDate)
Set MyDb = CurrentDb
Set MyRec = MyDb.OpenRecordset ("Select * From
qry_IB_0015_ctb_SQL_Summary_MaxDate")

'Check to ensure that the MSC Summary Table has been created for the
previous day's reconciliation
If MyRec![MSC] <> MyDate Then
MsgBox "The 2G Voice Summary Table has not been updated to include
yesterday's data", vbOKOnly, "EMT: Data Load Error"
Exit Sub
End If 'Close each if without the else because you have exit sub, easier
to manage

''Check to ensure that the ORC Summary Table has been created for the
previous day's reconciliation
If MyRec![ORC] <> MyDate Then
MsgBox "The ORCA Summary Table has not been updated to include
yesterday's
data", vbOKOnly, "EMT: Data Load Error"
Exit Sub
End If

etc .......
--
\\// Live Long and Prosper \\//
BS"D


Dann said:
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
 
G

Guest

Thankyou

This is exactly what i was looking for , i knew multiple dlookups were
inefficient but didnt know how to code it otherwise

Dan

Ofer said:
One thing, open a record set, instead of running Dlook up every time to
retrieve another field

Dim MyDB as Dao.DataBase, MyRec As Dao.RecordSet , MyDate As Date

MyDate = FormatDateTime((Now() - 1), vbShortDate)
Set MyDb = CurrentDb
Set MyRec = MyDb.OpenRecordset ("Select * From
qry_IB_0015_ctb_SQL_Summary_MaxDate")

'Check to ensure that the MSC Summary Table has been created for the
previous day's reconciliation
If MyRec![MSC] <> MyDate Then
MsgBox "The 2G Voice Summary Table has not been updated to include
yesterday's data", vbOKOnly, "EMT: Data Load Error"
Exit Sub
End If 'Close each if without the else because you have exit sub, easier
to manage

''Check to ensure that the ORC Summary Table has been created for the
previous day's reconciliation
If MyRec![ORC] <> MyDate Then
MsgBox "The ORCA Summary Table has not been updated to include
yesterday's
data", vbOKOnly, "EMT: Data Load Error"
Exit Sub
End If

etc .......
--
\\// Live Long and Prosper \\//
BS"D


Dann said:
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
 
G

Guest

Your welcome, have a great weekend

--
\\// Live Long and Prosper \\//
BS"D


Dann said:
Thankyou

This is exactly what i was looking for , i knew multiple dlookups were
inefficient but didnt know how to code it otherwise

Dan

Ofer said:
One thing, open a record set, instead of running Dlook up every time to
retrieve another field

Dim MyDB as Dao.DataBase, MyRec As Dao.RecordSet , MyDate As Date

MyDate = FormatDateTime((Now() - 1), vbShortDate)
Set MyDb = CurrentDb
Set MyRec = MyDb.OpenRecordset ("Select * From
qry_IB_0015_ctb_SQL_Summary_MaxDate")

'Check to ensure that the MSC Summary Table has been created for the
previous day's reconciliation
If MyRec![MSC] <> MyDate Then
MsgBox "The 2G Voice Summary Table has not been updated to include
yesterday's data", vbOKOnly, "EMT: Data Load Error"
Exit Sub
End If 'Close each if without the else because you have exit sub, easier
to manage

''Check to ensure that the ORC Summary Table has been created for the
previous day's reconciliation
If MyRec![ORC] <> MyDate Then
MsgBox "The ORCA Summary Table has not been updated to include
yesterday's
data", vbOKOnly, "EMT: Data Load Error"
Exit Sub
End If

etc .......
--
\\// Live Long and Prosper \\//
BS"D


Dann said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top