K
Kirk P.
I've got this code
Sub ImportCSV()
On Error GoTo ImportCSV_Err
DoCmd.SetWarnings False
DoCmd.OpenQuery "qdelOPT_DT_GAAP_SUMMARY_1", acViewNormal, acEdit
DoCmd.TransferText acImportDelim, "OPT_DT_GAAP_SUMMARY_1 Import Spec", _
"tblOPT_DT_GAAP_SUMMARY_1", "\\oprdgv1\depart\Finance\" & _
"_Health Solutions Group\Allocations\OPT_DT_GAAP_SUMMARY_1.csv",
True, ""
DoCmd.OpenQuery "qdelNon_Optum_BU", acViewNormal, acEdit
DoCmd.OpenQuery "qdelTieOpEx", acViewNormal, acEdit
DoCmd.OpenQuery "qdelAllocExpense", acViewNormal, acEdit
DoCmd.OpenQuery "qappAllocExpense", acViewNormal, acEdit
If DCount("*", "qselIn_GL_no_ARule") <> 0 Then
MsgBox "There are " & DCount("*", "qselIn_GL_no_ARule") & " records"
& vbCrLf & _
" with no allocation rules assigned!", vbInformation, "Note"
DoCmd.OpenForm "frmNoARule", acNormal, "", "", acReadOnly, acNormal
Resume ImportCSV_Exit
Else
DoCmd.OpenQuery "qupdARule", acViewNormal, acEdit
End If
MsgBox "File imported!", vbInformation, "Import Status"
ImportCSV_Exit:
DoCmd.SetWarnings True
Exit Function
ImportCSV_Err:
MsgBox "Error: " & Err.Number & " " & Err.Description
Resume ImportCSV_Exit
End Sub
It works well, with the exception of an "error 20 Resume with error" message
box that pops right after frmNoARule opens. How can I prevent this message
box from appearing?
Sub ImportCSV()
On Error GoTo ImportCSV_Err
DoCmd.SetWarnings False
DoCmd.OpenQuery "qdelOPT_DT_GAAP_SUMMARY_1", acViewNormal, acEdit
DoCmd.TransferText acImportDelim, "OPT_DT_GAAP_SUMMARY_1 Import Spec", _
"tblOPT_DT_GAAP_SUMMARY_1", "\\oprdgv1\depart\Finance\" & _
"_Health Solutions Group\Allocations\OPT_DT_GAAP_SUMMARY_1.csv",
True, ""
DoCmd.OpenQuery "qdelNon_Optum_BU", acViewNormal, acEdit
DoCmd.OpenQuery "qdelTieOpEx", acViewNormal, acEdit
DoCmd.OpenQuery "qdelAllocExpense", acViewNormal, acEdit
DoCmd.OpenQuery "qappAllocExpense", acViewNormal, acEdit
If DCount("*", "qselIn_GL_no_ARule") <> 0 Then
MsgBox "There are " & DCount("*", "qselIn_GL_no_ARule") & " records"
& vbCrLf & _
" with no allocation rules assigned!", vbInformation, "Note"
DoCmd.OpenForm "frmNoARule", acNormal, "", "", acReadOnly, acNormal
Resume ImportCSV_Exit
Else
DoCmd.OpenQuery "qupdARule", acViewNormal, acEdit
End If
MsgBox "File imported!", vbInformation, "Import Status"
ImportCSV_Exit:
DoCmd.SetWarnings True
Exit Function
ImportCSV_Err:
MsgBox "Error: " & Err.Number & " " & Err.Description
Resume ImportCSV_Exit
End Sub
It works well, with the exception of an "error 20 Resume with error" message
box that pops right after frmNoARule opens. How can I prevent this message
box from appearing?