Adding a field to an existing table via a module

D

Deece

I am trying to add a field to an existing table via a module as part of an
application. I am a new VB user and am unsure of the sytax to use. Can
anyone help.

Thanks
 
A

Alex Dybenko

Here a code snipset:

dbsData.TableDefs.Refresh
Set tdf = dbsData.TableDefs("MyTable")
Set fld = tdf.CreateField("NewField", dbText, 50)
tdf.fields.Append fld
Set tdf = Nothing
HTH
 
Top