I have a report that is bound to a query (qryReport) in this report I have a few textboxes that I need to get the data from another query (qryTop2Dates) I tried to use the DLookup function but I couldn't get it to work. :banghead: qryTop2Dates has the following Fields:
EMP_ID 'used as an employee ID Number
docType 'used for the type of training received..will be a number 1-4
docDate 'used for the date that training was issued
I need to get the most recent training for each employee and put that date in the textbox of the report. I used this in the Control Source :
This is giving me the MAX date of all the employees, not the MAX date for the EMP_ID in the report. So everyone is listed as having been trained on the same date. I am close, but not quite there. What am I missing?
EMP_ID 'used as an employee ID Number
docType 'used for the type of training received..will be a number 1-4
docDate 'used for the date that training was issued
I need to get the most recent training for each employee and put that date in the textbox of the report. I used this in the Control Source :
Code:
=DLookUp("MAX(docDate)","qryTop2Dates","docType=1 AND qryTop2Dates.EMP_ID= [EMP_ID]")