JGravesNBS
Registered User.
- Local time
- Today, 10:33
- Joined
- Apr 5, 2014
- Messages
- 58
This query works:
SELECT Max(tblMemPayment.id) AS MaxOfid, tblMemPayment.employee_id
from tblMemPayment
GROUP BY tblMemPayment.employee_id
HAVING (((tblMemPayment.employee_id)=1838));
I'm trying to move the SQL to a form and I'm getting:
Run-time error '13': Type mismatch
How can I adjust the following to work correctly?
Me.MemberIDOld contains 1838
Dim intResult As Integer
intResult = "SELECT Max(tblMemPayment.id) AS MaxOfid, tblMemPayment.employee_id from tblMemPayment GROUP BY tblMemPayment.employee_id HAVING (((tblMemPayment.employee_id) = " & Me.MemberIDOld & "))"
SELECT Max(tblMemPayment.id) AS MaxOfid, tblMemPayment.employee_id
from tblMemPayment
GROUP BY tblMemPayment.employee_id
HAVING (((tblMemPayment.employee_id)=1838));
I'm trying to move the SQL to a form and I'm getting:
Run-time error '13': Type mismatch
How can I adjust the following to work correctly?
Me.MemberIDOld contains 1838
Dim intResult As Integer
intResult = "SELECT Max(tblMemPayment.id) AS MaxOfid, tblMemPayment.employee_id from tblMemPayment GROUP BY tblMemPayment.employee_id HAVING (((tblMemPayment.employee_id) = " & Me.MemberIDOld & "))"