Creating tables on the fly
I have a database, where I create tables dynamically in code. These tables are temporary tables for which their size and fields are only known at runtime. I have no problem creating a table using the TableDef, Field and Index objects, however when I append the table to the database using CurrentDb.TableDefs.Append MyTable, the table does not appear in the list of tables in the left pane, even after having called CurrentDb.TableDefs.Refresh. The only way I can see it is to close and re-open the database.
When these tables are created, there is a lot of processing going on, so is it an Application level event that hasn't been able to fire? Will a strategically placed DoEvents do the job, or is it something else?
Many thanks for any help!
Keith
|