Hello Folks,
I am trying to run a findfirst on a double-click event and I am not sure i have the syntax correct:
The code below is what I have so far but the last piece of criteria "Supervisor" is not working as it should, depending on where I put the single quote, it will either give me any record for that EmployeeID meeting the previous criteria or just not work at all. What am I missing?
I am trying to run a findfirst on a double-click event and I am not sure i have the syntax correct:
The code below is what I have so far but the last piece of criteria "Supervisor" is not working as it should, depending on where I put the single quote, it will either give me any record for that EmployeeID meeting the previous criteria or just not work at all. What am I missing?
SQL:
Set rs = CurrentDb.OpenRecordset("SELECT * FROM [Employee Reviews]")
Dim EmployeeID As Integer
Dim Year As String
Dim Quarter As String
Dim Supervisor As String
Dim strCriteria As String
strCriteria = "EmployeeID=" & Me.EmployeeID & " AND [Year] = '2021'" & " AND Quarter = '3rd Qrtr'" & " AND 'Supervisor = Me.Supervisor'"
rs.FindFirst strCriteria
If Not rs.NoMatch Then
DoCmd.OpenForm "Quarterly-Review", , , strCriteria