Code to change a field name

  • Thread starter Thread starter Razor
  • Start date Start date
R

Razor

Hi,

I need to be able to change my table's field name from "X"
to "Y" using code executed from a form.

I could open a recordset object, but is there an API to do
this?

How would I do this?

Thanks,

Razor
 
Look in online help under DOA. See field object in help, it explains it
well. you need to create a field object, reference that field and change the
name property.
You can copy the sample and use the fields collection:
Fields("name")
once you reference your field reassign a name like:
field.name = "NewFieldName"
dont forget to close all objects.
 
Back
Top