Add field to table in another DB

irish634

Registered User.
Local time
Yesterday, 19:06
Joined
Sep 22, 2008
Messages
230
Well, I am still searching for an answer, but I thought I'd post while I continue looking.

I am creating an "update tool" for an existing database.
What I am trying to do is add a field to an existing table in a database from a user specified location.

Example:

  1. User browses for the existing file.
  2. I create a backup of the original.
  3. I'm updating some forms and reports. (I have this part no problem)
  4. I get hung up trying to add a field to a table.
My current code is this:
Code:
     Dim DBS As DAO.Database
    Dim TBL As DAO.TableDef
    Dim FLD As DAO.Field
    
    Set DBS = txt_Path
    Set TBL = DBS.TableDefs("subtbl_JobTracking")
    Set FLD = TBL.CreateField("txt_Description")
    
    FLD.Type = dbText
    FLD.Size = 255
    TBL.Fields.Append FLD
txt_Path is the full path to the database I want to update. I get a type mismatch here.

Any help or a link would be appreciated.

Craig
 

Users who are viewing this thread

Back
Top Bottom