Report Heading Parameter Look-up

  • Thread starter Thread starter Jim Shaw
  • Start date Start date
J

Jim Shaw

BlankIn my report heading is the name of a contact person to be called when
the report users need to ask a question about the report. The name of the
contact is in a parameter table:
tblAppState
-------------
ParamCode Integer
ParamText Text

A ParamCode value of 103 points to the record with the contact's name.
When I run the report, I want to access this name and put it into the report
heading.
How can I do this without doing an outer join of my underlying data table to
tblAppState?

Thanks
Jim
 
Jim said:
BlankIn my report heading is the name of a contact person to be called when
the report users need to ask a question about the report. The name of the
contact is in a parameter table:
tblAppState
-------------
ParamCode Integer
ParamText Text

A ParamCode value of 103 points to the record with the contact's name.
When I run the report, I want to access this name and put it into the report
heading.
How can I do this without doing an outer join of my underlying data table to
tblAppState?


Doing the Join would be the most efficient, but you can also
use a text box expression to look up the contact:

=DLookup("ParamText""tblAppState", "ParamCode=" & ParamCode)
 
I tried : =DLookUp("ParamText","tblAppState","ParamCode = " & 103)
also tried =DLookUp("ParamText","tblAppState","ParamCode = 103")
Both gave me the result of "#Error" in my textbox field. I've double
checked the table definition against my code and can't see the source of the
problem.

The underlying query already has an outer join so I'd have to do several
stacked queries to get the data in that way, so I was hoping for the
Dlookup() to work.

Thanks
Jim
 
Never mind, I figured it out...I was not putting the 103 in single quotes!
This works =DLookUp("ParamText","tblAppState","ParamCode = '103'")

Thanks
Jim


Jim Shaw said:
I tried : =DLookUp("ParamText","tblAppState","ParamCode = " & 103)
also tried =DLookUp("ParamText","tblAppState","ParamCode = 103")
Both gave me the result of "#Error" in my textbox field. I've double
checked the table definition against my code and can't see the source of the
problem.

The underlying query already has an outer join so I'd have to do several
stacked queries to get the data in that way, so I was hoping for the
Dlookup() to work.

Thanks
Jim


table
 
Back
Top