creating DAO problems

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.
 
N

Nikkos Yannacopoulos

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top