My Assistant
![]() ![]() |
|
|
Jan 10 2006, 02:43 PM
Post
#1
|
|
|
UtterAccess Guru Posts: 594 From: Cleveland, OH |
Anyone know how to use code to add columns to an existing table?
|
|
|
|
Jan 10 2006, 02:51 PM
Post
#2
|
|
|
UtterAccess VIP Posts: 31,413 From: NC, USA |
Hi,
check out the alter command: Currentdb.Execute "Alter Table TableName Add Column FieldName Text" You can find more examples searching on UA. HTH Good luck |
|
|
|
Jan 10 2006, 02:55 PM
Post
#3
|
|
|
UtterAccess Guru Posts: 594 From: Cleveland, OH |
great. Thanks.
One other quick question. how do you define the new column's format to be anything other than text? Such as integer, double, percent? Thanks again. |
|
|
|
Jan 10 2006, 03:00 PM
Post
#4
|
|
|
UtterAccess VIP Posts: 31,413 From: NC, USA |
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" datatype: DATETIME Text BoolField YESNO Integer Single Double ... HTH Good luck |
|
|
|
Jan 10 2006, 03:04 PM
Post
#5
|
|
|
UtterAccess Guru Posts: 594 From: Cleveland, OH |
thanks1
|
|
|
|
Jan 10 2006, 03:05 PM
Post
#6
|
|
|
UtterAccess VIP Posts: 31,413 From: NC, USA |
You're welcome.
Glad I could assist! |
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 18th June 2013 - 11:56 PM |