Coleman984
Registered User.
- Local time
- Today, 05:51
- Joined
- Jul 28, 2011
- Messages
- 89
See the below query, how would I write this into vba and have the criteria be set by cboNumber?
If anyone could help that would be greatly appreciated. I got this code from the query designer generated code.
I highlighted in red where I suspect I would change this to the combo box. Which would be me.cboNumber.value i believe.
But the problem still remains that I do not know how to get vba to change the query which is named Individual Employee Points to use this select statement from vba.
If anyone could help that would be greatly appreciated. I got this code from the query designer generated code.
I highlighted in red where I suspect I would change this to the combo box. Which would be me.cboNumber.value i believe.
But the problem still remains that I do not know how to get vba to change the query which is named Individual Employee Points to use this select statement from vba.
Code:
SELECT [tblEmployee.txtFName] & " " & [tblemployee.txtLName] AS [Full Name], [tblEmployee.empidno] AS [Employee ID #], Sum(IIf([fkAttendancetypeID]=2,1,IIf([fkAttendancetypeID]=3,0.5,IIf([fkAttendancetypeID]=4,0.5,IIf([fkAttendancetypeID]=5,1,0))))) AS [Total Points]
FROM (tblEmployee INNER JOIN tblEmployeeAttendance ON tblEmployee.pkEmployeeID = tblEmployeeAttendance.fkEmployeeID) INNER JOIN tblEmployeeJobDescriptions ON tblEmployee.pkEmployeeID = tblEmployeeJobDescriptions.fkEmployeeID
WHERE (((tblEmployee.dteInactive) Is Null))
GROUP BY [tblEmployee.txtFName] & " " & [tblemployee.txtLName], [tblEmployee.empidno]
HAVING ((([tblEmployee.empidno])=[COLOR="Red"]124102[/COLOR]) AND ((Sum(IIf([fkAttendancetypeID]=2,1,IIf([fkAttendancetypeID]=3,0.5,IIf([fkAttendancetypeID]=4,0.5,IIf([fkAttendancetypeID]=5,1,0))))))>0));