creating DAO problems

  • Thread starter Thread starter Eric Love
  • Start date Start date
E

Eric Love

I'm trying to append fields to an mdb table from an mde
running in runtime. I've done this many many times and
it's worked fine, but now it will not work. I get a
general event error with no details.


Dim db As Database
Dim tdf As TableDef
Dim fld1 As Field
Set db = OpenDatabase("M:\data.mdb")

Set tdf = db.TableDefs("AdminInfo")
Set fld1 = tdf.CreateField("MonPer1", dbLong)
tdf.Fields.Append fld1
RefreshDatabaseWindow

I'm running the code in an afterupdate event within a
form.
 
Eric,

Maybe you should try including the DAO. prefix to your
dim's:
Dim db As DAO.Database
Dim tdf As DAO.TableDef
Dim fld1 As DAO.Field

Nikos Y.
 
Back
Top