Code to change a field name

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
 
W

William Taylor

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.
 

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