Renaming Field Names In Tables

  • Thread starter Thread starter Guest
  • Start date Start date
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.
 
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"
 
Back
Top