This seems like it should be simple to do but i can't seem to get anything to work. I result i'm looking for is after a user selects a "Build Name" from a combo box it goes to the the table "tblWORK_DETAIL " and returns the field(in this case "RESOURCE_I D" where "WORK_DATE" is the newest work date for the given "BUILD_NAME ".
This is the SQL:
I've tried using a Dlookup function and that didn't work, i think the where clause is to complicated.
Any ideas of how i might go about this?
Eric
This is the SQL:
Code:
SELECT A.RESOURCE_ID FROM tblWORK_DETAIL A WHERE A.BUILD_NAME = forms.cboBUILD_NAME AND A.WORK_DATE = (SELECT MAX(B.WORK_DATE) FROM tblWORK_DETAIL B WHERE B.BUILD_NAME = A.BUILD_NAME AND B.WORK_DATE = A.WORK_DATE)
Code:
txtLAST_RESOURCE.Value = DLookup("resource_id", "tblWORK_DETAIL", "MAX(WORK_DATE)=WORK_DATE AND " & "BUILD_NAME = " & cboBUILD_NAME.Value)
Eric
Comment