Jan 10 2006, 02:43 PM
Anyone know how to use code to add columns to an existing table?
Jan 10 2006, 02:51 PM
check out the alter command:
Currentdb.Execute "Alter Table TableName Add Column FieldName Text"
You can find more examples searching on UA.
Jan 10 2006, 02:55 PM
One other quick question. how do you define the new column's format to be anything other than text?
Such as integer, double, percent?
Jan 10 2006, 03:00 PM
As mentioned search UA.
Instead of text define it as whatever you want. The syntax is:
CurrentDB.Execute "ALTER TABLE tableName ADD COLUMN columnName DataType"
Jan 10 2006, 03:04 PM
Jan 10 2006, 03:05 PM
Glad I could assist!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here