Renaming Field Names In Tables

G

Guest

Is it possible to rename fields in tables through code? I can't seem to find
anything that will work.

I have several field names in the same table where the field names contain
underscores. I want to replace the underscores with spaces.

Thanks for your help.
 
D

Douglas J. Steele

I'd recommend very strongly that you reconsider using blanks. Having blanks
in field names can lead to problems. I'd leave the underscores, or else
consider using Camel Case (MyFieldName, rather than My Field Name)

In any case, it's easy to rename a field using DAO.

CurrentDb().TableDefs("NameOfTable").Fields("OldNameOfField").Name =
"NewNameOfField"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top