jo15765
Well-known Member
- Joined
- Sep 23, 2011
- Messages
- 591
I found this code (I can't find the link back to it now
)
The problem I have is I tweaked the code to work for an array of databases, and it is only updating the 1st database, it is not dropping the table in the subsequent databases. What did I code wrong?
Code:
Sub RemoveTempTable()
Dim db As DAO.Database
Dim tdf As DAO.TableDef
Dim dbName() As Variant
Dim q As Variant
dbName = Array("One", "Two", "Three")
Set db = OpenDatabase("C:\" & dbName(q) & "\" & dbName(q) & "RPT.mdb")
For q = LBound(dbName) To UBound(dbName)
db.TableDefs.Delete "tbl_Test"
Next q
End Sub
The problem I have is I tweaked the code to work for an array of databases, and it is only updating the 1st database, it is not dropping the table in the subsequent databases. What did I code wrong?