SpaceCoastLife
asked on
Renaming field in code in an Access table
This should be a piece of cake for you experts!
In code, what's the syntax for renaming the field in a existing table? I'm thinking probably only one line but haven't figured it out. I'm using Access 2002
In code, what's the syntax for renaming the field in a existing table? I'm thinking probably only one line but haven't figured it out. I'm using Access 2002
Actually, I don't think you can change the name of the field in code.
I think you have to do it manually, or create a new column with the new (which you can do in code), then copy the values from the old field (also can do in code), and then delete the old column (also can be done in code).
Not sure why you would want to do this via code. This is a database maintenance thing and would involve changing that name in all references to that field (queries, code, control references).
Dale
I think you have to do it manually, or create a new column with the new (which you can do in code), then copy the values from the old field (also can do in code), and then delete the old column (also can be done in code).
Not sure why you would want to do this via code. This is a database maintenance thing and would involve changing that name in all references to that field (queries, code, control references).
Dale
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Not to worry. It's a tool. Never in production. Code works great. Thanks!
Use the fields collection of the table. I have no idea if this would work since this is not something I would ever do.