J
Joker via AccessMonster.com
Hello,
I have setup error handling in a module that runs a bunch of queries. For
one of them it connects to a database that is in a Microsoft workgroup of if
you try running the query while not signed into the work groups you get an
error. I have setup my error handling to catch that error but it seems to be
skipping it and still shows the error leaving my code open. Any thoughts?
Code below..
Private Sub Command5_Click()
On Error GoTo Err_AStoopidFreakinError2
DoCmd.SetWarnings False
'Runs all of the queries to get all the information setup (except the
remit date)
DoCmd.OpenQuery "qry_CompileImportDIL", acViewNormal
DoCmd.OpenQuery "qry_Payoffs", acViewNormal
DoCmd.OpenQuery "qry_FindCurrentRemits", acViewNormal
DoCmd.OpenQuery "qry_FindCurrentPayoffs", acViewNormal
DoCmd.OpenQuery "qry_CurrentRegister_WithPayoffs", acViewNormal
DoCmd.OpenQuery "qry_CompleteRegister(NoDueDates)", acViewNormal
'This query appends all the data worked out into "tbl_MAIN"
DoCmd.OpenQuery "qry_AppendToMain", acViewNormal
'Deletes all the make-tables so they can be replaced when the dB is run
next time
'DoCmd.DeleteObject acTable, "register_ImportErrors"
DoCmd.DeleteObject acTable, "tbl_CombinedInfo"
DoCmd.DeleteObject acTable, "tbl_CompleteRegister(NoDueDates)"
DoCmd.DeleteObject acTable, "tbl_CurrentRegister_WithPayoffs"
DoCmd.DeleteObject acTable, "tbl_payoffs"
DoCmd.DeleteObject acTable, "tbl_Payoffs_On_CurrentRegister"
DoCmd.DeleteObject acTable, "tbl_Registerxls"
DoCmd.DeleteObject acTable, "tbl_WirePayoffInfo"
'Runs all the queries to calculate the due date for the wires and puts it
into tbl_MainHolding
DoCmd.OpenQuery "qry_RunCodeInterim", acViewNormal
DoCmd.OpenQuery "qry_NotNullRemits", acViewNormal
DoCmd.OpenQuery "qry_RunCode", acViewNormal
DoCmd.OpenQuery "qry_EndResult2MainBS", acViewNormal
DoCmd.OpenQuery "qry_UpdateDtDiff_InMAINBS", acViewNormal
DoCmd.OpenQuery "qry_RunCodeDaily", acViewNormal
DoCmd.OpenQuery "qry_RunCodeTomorrow", acViewNormal
'This query appends all data from tbl_END_RESULT table to the archive dB
'Located at: S:\Iashare\Private-REMIC\Remittance Register\Remittance
Register dB\Back Up dB\Remittance Register Archived Data.mdb
DoCmd.OpenQuery "qry_Archive", acViewNormal
DoCmd.SetWarnings True
Exit_Here4:
Exit Sub
'Error Handler
Err_AStoopidFreakinError2:
Select Case Err.Number
Case 3033
MsgBox ("You must be logged into the Microsoft User Work Groups to
run this!" & Chr(13) & "The icon looks like a fox. Contact the support team
if you need to request access")
MsgBox ("You have recieved an error" & Err.numbernumber & Err.
Description & Chr(13) & "Please finish running the database buttons," & Chr
(13) & " then redo it to make sure you recieve proper output." & Chr(13) &
"If you still are having problems contact your support team.")
Resume Exit_Here4
Case 999
Resume Exit_Here4
Case Else
MsgBox ("You have recieved an error" & Err.numbernumber & Err.Description &
Chr(13) & "Please finish running the database buttons," & Chr(13) & " then
redo it to make sure you recieve proper output." & Chr(13) & "If you still
are having problems contact your support team.")
Resume Exit_Here4
End Select
End Sub
I have setup error handling in a module that runs a bunch of queries. For
one of them it connects to a database that is in a Microsoft workgroup of if
you try running the query while not signed into the work groups you get an
error. I have setup my error handling to catch that error but it seems to be
skipping it and still shows the error leaving my code open. Any thoughts?
Code below..
Private Sub Command5_Click()
On Error GoTo Err_AStoopidFreakinError2
DoCmd.SetWarnings False
'Runs all of the queries to get all the information setup (except the
remit date)
DoCmd.OpenQuery "qry_CompileImportDIL", acViewNormal
DoCmd.OpenQuery "qry_Payoffs", acViewNormal
DoCmd.OpenQuery "qry_FindCurrentRemits", acViewNormal
DoCmd.OpenQuery "qry_FindCurrentPayoffs", acViewNormal
DoCmd.OpenQuery "qry_CurrentRegister_WithPayoffs", acViewNormal
DoCmd.OpenQuery "qry_CompleteRegister(NoDueDates)", acViewNormal
'This query appends all the data worked out into "tbl_MAIN"
DoCmd.OpenQuery "qry_AppendToMain", acViewNormal
'Deletes all the make-tables so they can be replaced when the dB is run
next time
'DoCmd.DeleteObject acTable, "register_ImportErrors"
DoCmd.DeleteObject acTable, "tbl_CombinedInfo"
DoCmd.DeleteObject acTable, "tbl_CompleteRegister(NoDueDates)"
DoCmd.DeleteObject acTable, "tbl_CurrentRegister_WithPayoffs"
DoCmd.DeleteObject acTable, "tbl_payoffs"
DoCmd.DeleteObject acTable, "tbl_Payoffs_On_CurrentRegister"
DoCmd.DeleteObject acTable, "tbl_Registerxls"
DoCmd.DeleteObject acTable, "tbl_WirePayoffInfo"
'Runs all the queries to calculate the due date for the wires and puts it
into tbl_MainHolding
DoCmd.OpenQuery "qry_RunCodeInterim", acViewNormal
DoCmd.OpenQuery "qry_NotNullRemits", acViewNormal
DoCmd.OpenQuery "qry_RunCode", acViewNormal
DoCmd.OpenQuery "qry_EndResult2MainBS", acViewNormal
DoCmd.OpenQuery "qry_UpdateDtDiff_InMAINBS", acViewNormal
DoCmd.OpenQuery "qry_RunCodeDaily", acViewNormal
DoCmd.OpenQuery "qry_RunCodeTomorrow", acViewNormal
'This query appends all data from tbl_END_RESULT table to the archive dB
'Located at: S:\Iashare\Private-REMIC\Remittance Register\Remittance
Register dB\Back Up dB\Remittance Register Archived Data.mdb
DoCmd.OpenQuery "qry_Archive", acViewNormal
DoCmd.SetWarnings True
Exit_Here4:
Exit Sub
'Error Handler
Err_AStoopidFreakinError2:
Select Case Err.Number
Case 3033
MsgBox ("You must be logged into the Microsoft User Work Groups to
run this!" & Chr(13) & "The icon looks like a fox. Contact the support team
if you need to request access")
MsgBox ("You have recieved an error" & Err.numbernumber & Err.
Description & Chr(13) & "Please finish running the database buttons," & Chr
(13) & " then redo it to make sure you recieve proper output." & Chr(13) &
"If you still are having problems contact your support team.")
Resume Exit_Here4
Case 999
Resume Exit_Here4
Case Else
MsgBox ("You have recieved an error" & Err.numbernumber & Err.Description &
Chr(13) & "Please finish running the database buttons," & Chr(13) & " then
redo it to make sure you recieve proper output." & Chr(13) & "If you still
are having problems contact your support team.")
Resume Exit_Here4
End Select
End Sub