DlookUp(“Express”, Domain, Criteria)

1hok3

New member
Local time
Tomorrow, 04:40
Joined
Oct 27, 2011
Messages
4
Hi!
I want to use DlookUp(“Express”, Domain, Criteria) in my report. The problem is that, “Express” is a fixed [field name], but I want the field name to be changed depending on the CONTENT in a Text Box I define on the report. It mean the CONTENT is the name of the field. How can I do this? Anyone can help please? Thank.
 
Your report is going to be very slow. You use:
Code:
=DLookup([Content], "Domain", "Criteria")
Notice that content is not in quotes.
 
I have tried it, but it doesn't work as what I wanted.
Here is The details of my job:
I make cross query, so I will get the different Field name depend on the data. Ex. i make a cross query ("Sale") with field name like this:
[Description],[Quarter_2_of_2011],[Quarter_3_of_2011][Quarter_4_of_2011], [Quarter_1_of_2012], and so on....
and Data:
A, 10, 20, 30, 40
B, 15, 25, 35, 45
C, 20, 25, 30, 35 .....

I want to make a report that show only one or two of [Quarter_*_of_201*]. If I use Dlookup([Quarter_2_of_2011],"Sale",[Description]), the result of the report will be:
[Description],[[Quarter_2_of_2011]
a, 10
b, 15
c, 20

So when I want to make the report of Other Quarter, i have to revise [Quarter_2_of_2011] in DLookup function. I don't want to do so. I mean if i draw a Textbox and the content of the the textbox will replace as the field name of the [Quarter_2_of_2011] in DLookup. Is it possible? And how? Thank in advance for yr reply.
 
Using DLookup() that way won't work. You will need to build your query in code.
 

Users who are viewing this thread

Back
Top Bottom