Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ALTER TABLE ALTER COLUMN

Status
Not open for further replies.

Kiwiman

Technical User
May 6, 2005
88
GB
Hi

I am trying to rename an existing colmn in one of my tables dynamically, but come up with the following error message. I am not sure how to get around this. I want to change the column called Month1 to Test

Code:
ALTER Column tblSummary
ALTER COLUMN month1 to TEST;

Any help would be appreciated

Thanks
Les
 
You can't rename a column with DDL.
You may use the DAO.Fields collection of a DAO.TableDef object:
Dim db Ad DAO.DataBase, tdf As DAO.TableDef
Set db = CurrentDb
Set tdf = db.TableDefs("tblSummary")
tdf.Fields("month1").Name = "TEST"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top