View Full Version : Changing Field Name


aziz rasul
01-18-2008, 06:10 AM
I can't get the following statement to work in changing a field name.

CurrentDb.Execute "ALTER TABLE PivotCalculation CHANGE Field1 Field2;"
I get run-time error 3293 i.e. Syntax error in ALTER TABLE statement.

DJkarl
01-18-2008, 06:32 AM
I can't get the following statement to work in changing a field name.

CurrentDb.Execute "ALTER TABLE PivotCalculation CHANGE Field1 Field2;"
I get run-time error 3293 i.e. Syntax error in ALTER TABLE statement.

Yup, CHANGE isn't valid in Access, if you want to change the column name you'll need to use tabledefs.

aziz rasul
01-18-2008, 06:35 AM
I tried this

CurrentDb.TableDefs("PivotCalculation").Fields("Field1").Name = "Field2"

Thanks for pointing me in the right direction.