I am just starting out. I created a database with nothing in it and trying to create a simple table. I run MainTest and don’t get an error. I go back into the Application window expecting to see the new table named “NewTable”. Its not there. What am I doing wrong?
Option Compare Database
Option Explicit
Sub CreateTable()
Dim tblNew As DAO.TableDef, DB As DAO.Database, Fld As DAO.Field
Set DB = CurrentDb
Set tblNew = DB.CreateTableDef("NewTable")
Set Fld = tblNew.CreateField("Num1", dbLong)
tblNew.Fields.Append Fld
End Sub
Sub MainTest()
CreateTable
End Sub
Thanks in advance