IF you want to check whether the table exists in the database or not , and if found then delete the table.
Here is the code-
Sub check_if_table_exits_and_delete_it()
Dim tbl As DAO.TableDef
Dim found As Boolean
Dim tbl_name_to_check As String
tbl_name_to_check = "28_Dec_2011_14_06"
found = False
For Each tbl In CurrentDb.TableDefs
If tbl.Name = tbl_name_to_check Then
found = True
Exit For
End If
Next
If found = True Then
CurrentDb.TableDefs.Delete tbl.Name
MsgBox "Table Found and Deleted", vbInformation
Else
MsgBox "Table Not Found", vbInformation
End If
End Sub
Download Access Database
No comments:
Post a Comment