By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,587 Members | 1,071 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,587 IT Pros & Developers. It's quick & easy.

Invalid Field Data Type

P: 179
From one database, I am trying to create a table in a different database. Here is my code:

Dim dbDeja As DAO.Database
Dim tblEmployees As DAO.TableDef
Dim fldEmployeeNumber As Field

' Open the database
Set dbDeja = DBEngine.OpenDatabase("C:\Database Files\Access 2003\GCS2.mdb")

' Create a new TableDef object.
Set tblEmployees = dbDeja.CreateTableDef("Employers")
Set fldEmployeeNumber = tblEmployees.CreateField("EmployeeNumber")
tblEmployees.Fields.Append fldEmployeeNumber

' Add the new table to the database.
dbDeja.TableDefs.Append tblEmployees

The error I'm getting is "Invalid Field Data Type", and the debugger points to the second last line (dbDeja.TableDefs.Append tblEmployees).

Does anyone have any ideas as to why I'm getting this error. Thanks.

Jul 15 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.