We value your feedback.
Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
Public Sub CreateInvoiceTable() Dim cat As ADOX.Catalog Dim tbl As ADOX.Table 'Create and connect a catalog object Set cat = New ADOX.Catalog cat.ActiveConnection = CurrentProject.Connection On Error Resume Next 'If the table already exists, delete it cat.Tables.Delete "tblInvoice" On Error GoTo 0 'Create the table definition in memory Set tbl = New ADOX.Table tbl.Name = "tblInvoice" 'Create the new columns tbl.Columns.Append "InvoiceNo", adVarChar, 10 'Create the remaining columns tbl.Columns.Append "InvoiceDate", adDBDate tbl.Columns.Append "CustomerID", adInteger tbl.Columns.Append "Comments", adVarChar, 50 Debug.Print tbl.Name 'Append the new table to the collection cat.Tables.Append tbl 'Error occurs here cat.Tables.Refresh Application.RefreshDatabaseWindow 'Clean up cat.ActiveConnection = Nothing Set tbl = Nothing Set cat = Nothing End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.