J
Jon A
I can't seem to figure this out.
I have a database where all the tables are in a separate
back-end linked file. There were some tables in the initial
version of the database that I want to delete.
I can delete the actual tables by using the procedure below.
That works successfully.
But the links in the front-end are still there. So when I
try to do any update down the road I will get an error when
linking the tables (I have a procedure that automatically
links the tables but when there is a link in the front-end
and no table in the back-end then I get an error.)
Like I said, the actual tables get deleted OK when I run the
code below - but not the links.
I have several things:
CurrentDB.TableDefs.Refresh (after deleting the table)
db.TableDefs.Delete "tbl_DefectTypes"
Neither of these seem to get rid of the links and I get
errors on the second one saying the table isn't there.
I'm stumped. Anyone can help?
Here is the code...
==========================================
Public Function DeleteUnnecessaryTables() As Boolean
Dim strSQL As String
DoCmd.SetWarnings False
strSQL = "Drop Table tbl_DefectTypes;"
DoCmd.RunSQL strSQL
DoCmd.SetWarnings True
DeleteUnnecessaryTables = True
End Function 'DeleteUnnecessaryTables
==========================================
I have a database where all the tables are in a separate
back-end linked file. There were some tables in the initial
version of the database that I want to delete.
I can delete the actual tables by using the procedure below.
That works successfully.
But the links in the front-end are still there. So when I
try to do any update down the road I will get an error when
linking the tables (I have a procedure that automatically
links the tables but when there is a link in the front-end
and no table in the back-end then I get an error.)
Like I said, the actual tables get deleted OK when I run the
code below - but not the links.
I have several things:
CurrentDB.TableDefs.Refresh (after deleting the table)
db.TableDefs.Delete "tbl_DefectTypes"
Neither of these seem to get rid of the links and I get
errors on the second one saying the table isn't there.
I'm stumped. Anyone can help?
Here is the code...
==========================================
Public Function DeleteUnnecessaryTables() As Boolean
Dim strSQL As String
DoCmd.SetWarnings False
strSQL = "Drop Table tbl_DefectTypes;"
DoCmd.RunSQL strSQL
DoCmd.SetWarnings True
DeleteUnnecessaryTables = True
End Function 'DeleteUnnecessaryTables
==========================================