Column Name based on value in another table (1 Viewer)

hllary

Registered User.
Local time
Today, 05:32
Joined
Sep 23, 2019
Messages
80
I've searched around a bit but I can't find an answer. Is it possible to name a column in a table based on a value in another table?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 05:32
Joined
Oct 29, 2018
Messages
21,477
Are you asking manually or in code?
 

plog

Banishment Pending
Local time
Today, 07:32
Joined
May 11, 2011
Messages
11,648
No, and that's a very ominous question. What do you hope to accomplish by that? How are your tables set up?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 05:32
Joined
Oct 29, 2018
Messages
21,477
Either would work.
You might still have to provide some context for us to fully understand your question. If you go to the table's design view, you can manually name the field to whatever you want.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 08:32
Joined
May 21, 2018
Messages
8,537
Sure it can be done, but likely should not be done. Does not make much sense to me and likely your tables are not designed correctly.
 

hllary

Registered User.
Local time
Today, 05:32
Joined
Sep 23, 2019
Messages
80
No, and that's a very ominous question. What do you hope to accomplish by that? How are your tables set up?
The data in the column is an equation based on the number of vehicles in another table. The users would like to have the number of vehicles used in the equation shown in the header.
Are you asking manually or in code?
Either would work
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 08:32
Joined
May 21, 2018
Messages
8,537
This still does not really make any sense. Can you provide a sample db or some table data? It almost sounds like something you would do in a cross tab query, but not in a table.
 

hllary

Registered User.
Local time
Today, 05:32
Joined
Sep 23, 2019
Messages
80
Thanks you everyone's help. From my research and what everyone has said, naming a column in a header based on a value in another table is not possible.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 08:32
Joined
May 21, 2018
Messages
8,537
As I said it is definitely possible, I think what we all are asking is if it is logical.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 05:32
Joined
Oct 29, 2018
Messages
21,477
Thanks you everyone's help. From my research and what everyone has said, naming a column in a header based on a value in another table is not possible.
I would also say this is very possible, and a crosstab query, as @MajP mentioned earlier, is probably what you're after.
 

plog

Banishment Pending
Local time
Today, 07:32
Joined
May 11, 2011
Messages
11,648
The users would like to have the number of vehicles used in the equation shown in the header.

You posted this question in the table forum and specifically used the term "table" in your question. Users should not interact directly with tables in a database. Instead they should access data via Forms and Reports. Putting data into headers of those is possible and trivial.
 

Users who are viewing this thread

Top Bottom