Private Sub Command12_Click()
On Error GoTo SubError
DoCmd.SetWarnings False
Const fName As String = "C:\Users\brweekley\Documents\Databases\Funding_Database\IHS - Allowance Status by Locat.xlsx"
DoCmd.OpenQuery "Delete_IHS - Allowance Status by Locat"
' True means the spreadsheet has column names for the first row
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel12Xml, "IHS - Allowance Status by Locat", _
fName, True, "IHS - Allowance Status by Locat!"
MsgBox "Worksheet imported!", vbInformation + vbOKOnly, "Success"
DoCmd.OpenQuery "UpdateImportTable_Q"
DoCmd.RefreshRecord
DoCmd.SetWarnings True
SubExit:
On Error Resume Next
Exit Sub
SubError:
MsgBox "Error Number: " & Err.Number & " = " & Err.Description, vbCritical + vbOKOnly, _
"An error occurred."
GoTo SubExit
End Sub