I have this select statement that I want to run in a form then pass the results when I open a report:
"SELECT Max(tblPosition.POSID) AS MaxOfPOSID" & _
"FROM tblPosition" & _
"GROUP BY tblPosition.EMPID" & _
"HAVING (((tblPosition.EMPID)=[Forms]![frmEmployee]![txtEMPID]));"
Right now I have the report opening to match the employee ID that I see on the form.
stDocName = "rptEmployee"
stLinkCriteria = "[EmpID]=" & Me![txtEMPID] <- would like to add another criteria to it for the POSID from the select statement above.
DoCmd.OpenReport stDocName, , acViewPreview, stLinkCriteria
Thank you,