I am working with an Access databasein VBA through Excel. I want to check if a table in the DB exists, and then if not, I want to create the table using the same fields/definitions as a table labeled "Blank" in that database. I can simply copy/rename Blank if necessary.
I found a way to check if the table exists using the following (not sure if it is the best way though).
Set objCatalog = CreateObject("ADOX.catalog")
objCatalog.ActiveConnection = dbConn
For i = 0 To objCatalog.Tables.Count - 1
If objCatalog.Tables.Item(i).Name = tbName Then tbExists = True
Next
This works, but I'm struggling to find a way to copy or create a new table using Blank's fields/definitions when the destination table does not exist (tbExists = False).