Define field name by textbox content or value

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • 1hok3
    New Member
    • Oct 2011
    • 2

    Define field name by textbox content or value

    Hi!
    I want to use DlookUp(“Expres s”, 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.

    ** Edit **

    Here is The details:
    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_20 11],[Quarter_3_of_20 11][Quarter_4_of_20 11], [Quarter_1_of_20 12], 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_20 1*]. If I use Dlookup([Quarter_2_of_20 11],"Sale",[Description]), the result of the report will be:
    [Description],[[Quarter_2_of_20 11]
    a, 10
    b, 15
    c, 20

    So when I want to make the report of Other Quarter, i have to revise [Quarter_2_of_20 11] 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_20 11] in DLookup. Is it possible? And how? Thank in advance for yr reply.
    Last edited by NeoPa; Oct 28 '11, 11:46 AM. Reason: Added in details that should have been in here originally.
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32668

    #2
    Instead of using "Express", try instead [YourTextBoxName]. You haven't shared many details with us so you'll have to determine the name and use it for yourself.

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32668

      #3
      Your extra details do not change the answer that's already been posted. You still need to work out what the control names are for the various column headings and use those, or labels (and you'd use the Caption property instead), in place of your literal string "Express".

      Comment

      Working...