Changing Field Name

aziz rasul

Active member
Local time
Today, 22:16
Joined
Jun 26, 2000
Messages
1,934
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.
 
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.
 
I tried this

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

Thanks for pointing me in the right direction.
 

Users who are viewing this thread

Back
Top Bottom