469,348 Members | 1,265 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,348 developers. It's quick & easy.

Dynamically Renaming Fields?

Is there any way to setup a make-table query so that it names the
fields of the new table based on values in a different table.

For example, I have the following fields: Noun, Adjective, Modi 1 Name,
Mod 2 Name, Mod 1 Val, and Mod 2 Val. Listed under these fields are
the records of the table and the value of each field.
Noun | Adjective | Mod 1 Name | Mod 2 Name|Mod 1 Val|Mod 2 Val|
-------|------------|------------|-----------|---------|---------|
<name> |<adjective> | Value | Power | 255 | 65W |
<name2>|<adjective2>| Tolerance | Package | 5% | 0603 |
-------|------------|------------|-----------|---------|---------|

Is there a way to use a make-table query to make a new table that
automatically names the fields based on a value in a table?

The new tables made from a make-table query:

New Table 1:

Noun | Adjective | Value | Power |
-------|--------------|--------|-------|
<name> | <adjective> | 255 | 65W |
----------------------------------------

New Table 2:

Noun | Adjective | Tolerance | Package |
-------|--------------|-----------|---------|
<name> | <adjective> | 5% | 0603 |
---------------------------------------------

Nov 13 '05 #1
1 1351
Certainly, simply create "calculated fields" in the Select Query that you
convert to MakeTable. For example, if I have a table with fields of RowID,
Room, Chair1, and Chair2, and want a new table with Row, Place, Person1, and
Person2, then in the Query grid, I'd have the following:

Row | Place: Room | Person1:Chair1 | Person2:Chair2

and if you look at SQL View, you'll see

SELECT tblMadeANew1.RowID AS Row, tblMadeANew1.Room AS Place,
tblMadeANew1.Chair1 AS Person1, tblMadeANew1.Chair2 AS Person2 INTO
tblMakeANew3
FROM tblMadeANew1;

Larry Linson
Microsoft Access MVP
"Kosio" <aa********@gmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
Is there any way to setup a make-table query so that it names the
fields of the new table based on values in a different table.

For example, I have the following fields: Noun, Adjective, Modi 1 Name,
Mod 2 Name, Mod 1 Val, and Mod 2 Val. Listed under these fields are
the records of the table and the value of each field.
Noun | Adjective | Mod 1 Name | Mod 2 Name|Mod 1 Val|Mod 2 Val|
-------|------------|------------|-----------|---------|---------|
<name> |<adjective> | Value | Power | 255 | 65W |
<name2>|<adjective2>| Tolerance | Package | 5% | 0603 |
-------|------------|------------|-----------|---------|---------|

Is there a way to use a make-table query to make a new table that
automatically names the fields based on a value in a table?

The new tables made from a make-table query:

New Table 1:

Noun | Adjective | Value | Power |
-------|--------------|--------|-------|
<name> | <adjective> | 255 | 65W |
----------------------------------------

New Table 2:

Noun | Adjective | Tolerance | Package |
-------|--------------|-----------|---------|
<name> | <adjective> | 5% | 0603 |
---------------------------------------------

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by EmmettPower | last post: by
1 post views Thread by Don Leverton | last post: by
4 posts views Thread by Stone Chen | last post: by
8 posts views Thread by BillCo | last post: by
12 posts views Thread by filia&sofia | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.