Private Sub TestTemp() On Error GoTo ErrorHandler Dim strSQL as String Dim strTable as String strTable = "tblTempTest" 'Delete the table if it exists DoCmd.DeleteObject acTable, strTable strSQL = "Select * INTO " & strTable & " FROM tblCustomers " & _ "Where CustomerState = 'ILL'" Currentdb.Execute strSQL 'Insert more code here to do something with temp table Exit Sub ErrorHandler: IF Err.Number = 7874 Then Resume Next 'Tried to delete a non-existing table, resume End If End Sub