Solved Add a column to a Linked table

InFlight

User
Local time
Tomorrow, 05:29
Joined
Jun 11, 2015
Messages
130
Hi
I have a database that I need to add a column to a table in a linked database.

eg
C:\Test\test.accdb

linked DB is
C:\Test\Data\Data.accdb
the table is Exhibitors and the I'm trying to add is Certificate YESNO

using VBA
CurrentDb.Execute "Alter Table Exhibitors add column Certificate YESNO"

I have quite a few to update around the country all with different data
 
I don't know why you want to do this via VBA. That is not normal practice. However, I have an application which is sold to the public and so if release an upgrade, I can't personally apply it so I create a custom upgrade .accdb for each ver-ver change. I'll attach a database so you can see how it works. Open the db and put the form in design view to see how it works.
 

Attachments

In addition to using the ALTER TABLE you could "push" and empty table to the back-end from the front-end, please see my example here:

Cheers,
 
Code:
Dim db As DAO.Database
Set db = OpenDatabase("C:\Test\Data\Data.accdb")

db.Execute "ALTER TABLE Exhibitors ADD COLUMN Certificate YESNO;"
 
Here is a table editor form I developed based on various code snippets I found from a few websites to allow editing a local or linked table which I used during development. Allows changing name(s) of fields, adding and removing fields etc.

Import the three objects (tblTableActions, frmTableEditor and modTableEditor) into your database.
To use, open frmTableEditor and select the table and action.
 

Attachments

Users who are viewing this thread

Back
Top Bottom