Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DLookup in Report displays Name#

Status
Not open for further replies.

MaddiMond

Technical User
Mar 28, 2005
76
0
0
US
I tried to use DLookUp in the expression of a control on a report to lookup a value in a query. I get Name# and I think it might have to do that I have to criteria.
"[EmployeeID]"= Forms![rptMain]![EmployeeID] & "[YearMonth]"=Forms![rptMain]![MonthYear])

Or can I not lookup values in a query?
How can I accomplish anything like this?

Thanks.

Maddi
 
Could you explain a little bit more what you are trying to show in the field? Is [EmployeeID] the field name? If you are trying to use the Dlookup function, it should look something like this:

DLookup("FieldName" , "TableName" , "Criteria = n")

Not sure if you can grab it from a query, but you may be able to get the value from the table and then re-create the value on the form that you are using.
 
How about:
[tt]"[EmployeeID]=" & Forms![rptMain]![EmployeeID] & " AND [YearMonth]=" & Forms![rptMain]![MonthYear])[/tt]

Assuming that both fields are numeric.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top