Dlookup Column Name based off of Report Grouping

G

gumby

Can you dlookup a column name based off of report grouping? I got it
to dlookup based off of a column criteria.

=dlookup("[columnname] that equals [Report Grouping]", "tablename")

The table a looks like this

[Month] [5] [6] [7] [8] [9] [10]


Thre report is grouped by the the numbers but from a different table
b.

I need to plug in the columns from the table a into the report based
off the groupings from table b.

Thanks,
David
 
D

Douglas J. Steele

Sorry if this seems abrupt, but your table design is inappropriate. Field
names like [5], [6], [7] imply that the name of the field has some meaning:
that for a given month, you're storing 6 different values, one for Report
Grouping 5, one for Report Grouping 6 and so on.

You should have 6 rows in a table, not 6 columns in a single row (and you
should never name a field Month, as that's a reserved word).

If your table were amended to look like:

[ReportMonth] [ReportGroup] [ReportValue]

your lookup becomes trivial.
 
G

gumby

Thank you.

Sorry if this seems abrupt, but your table design is inappropriate. Field
names like [5], [6], [7] imply that the name of the field has some meaning:
that for a given month, you're storing 6 different values, one for Report
Grouping 5, one for Report Grouping 6 and so on.

You should have 6 rows in a table, not 6 columns in a single row (and you
should never name a field Month, as that's a reserved word).

If your table were amended to look like:

[ReportMonth] [ReportGroup] [ReportValue]

your lookup becomes trivial.

--
Doug Steele, Microsoft Access MVPhttp://I.Am/DougSteele
(no private e-mails, please)




Can you dlookup a column name based off of report grouping? I got it
to dlookup based off of a column criteria.
=dlookup("[columnname] that equals [Report Grouping]", "tablename")
The table a looks like this
[Month] [5] [6] [7] [8] [9] [10]
Thre report is grouped by the the numbers but from a different table
b.
I need to plug in the columns from the table a into the report based
off the groupings from table b.
Thanks,
David- Hide quoted text -

- Show quoted text -
 

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