Update Field Names

C

Craig

Is there a way to programatically update field names in one table based on a
list in another table. I have 70 sets of data with the data in one table
and the field types map in a another table.

Table A:

District1 District2 District3
y y y
y y n


Table B;

District Type
District1 HaveDog
District2 HaveCat
District3 HaveOtherPet


I want to update the Field names in Table A from District# to the Type name
in Table B.

I would appreciate any help.
Thanks
Craig
 
M

Michel Walsh

Tables are not designed to see their fields name changed (at least, not on a
regular basis).

If you use a FORM (or report) to see your data, then, instead of LABEL
generally used to display the field name (or the field caption), use a TEXT
edit control, and bind them to (make its control source ) :

=DLookup( "type", "tableB", "District= 'District1' " )

for the first column, and so on for the second and third column, using
'District2' and 'District3'.


Hoping it may help,
Vanderghast, Access MVP
 
C

Craig

Using a Form or Report is all well and good, but in this case I am not using
either. I am trying to make the Field Names match to the Data so can use
the data effectively.

I NEED to change the field names so I can combine all data sets. I cannot
do that if Table1/Field-District1 = HaveDog and
Table2/Field-District1=HaveCat

So the orginal data table and the field definition table I would like to
combine together.

So, i ask the question again, is there a way to programatically update field
names in one table from data in another table.

Thanks for any help

Craig
 
J

Jeff Boyce

Craig

I'm not very clear on what you are trying to do.

It sounds like you want to modify the names of fields, so I'm wondering why?
In a well-normalized relational database design, you would only very rarely
need to modify the design (e.g., fieldnames).

If you'll describe a bit more about what you expect to accomplish (and not
"how" you are trying to do something), the newsgroup readers may be able to
offer alternate approaches.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 

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