Gene,
You cannot use a local form variable as a parameter in a query. You can directly reference the control itself as suggested by Welshgasman in the previous post or you can use a tempvar or a custom VBA function that uses a global variable (so basically you declare vMID as Public in a standard module and have a function that returns its value):
Code:
Option Explicit
Public vMID as Long
Public Function fnMid() as Long
fnMid=vMID 'the value of vMID is set in the click event of the button just as you have it now.
End Function
The SQL becomes:
SELECT tblPerformanceData.ManagerID, tblPerformanceData.DataTypeCode,
FROM tblPerformanceData
WHERE [tblPerformanceData].[managerid]=fnMID();
Cheers,