change the code on a UNIVERSAL basis, my friend. always follow standards on a global scale. you'll love yourself later on when you're forced to debug!
try this instead (copy this verbatim):
Code:
Private Function setFormRecordSource(Optional activeEmployeesOnly As Boolean)
'//set the form's RecordSource
Dim strFilter As String
Dim srcFirst As String
Dim srcLast As String Me.FilterOn = False 'ADDED
Me.OrderByOn = False 'ADDED
strFilter = "[employeeNumber] <> 9000"
Me.RecordSource = "Employees"
Me.OrderBy = "[Lname], [Fname]"
If Me.chkActive.Value = -1 Or activeEmployeesOnly Then
Me.cmbFirst.RowSource = "SELECT Fname, Lname FROM Employees WHERE Active = 'Y' ORDER BY Fname;"
Me.cmbLast.RowSource = "SELECT Lname, Fname FROM Employees WHERE Active = 'Y' ORDER BY Lname;"
strFilter = strFilter & " AND [Active] = 'Y'"
Else
Me.cmbFirst.RowSource = "SELECT Fname, Lname FROM Employees ORDER BY Fname;"
Me.cmbLast.RowSource = "SELECT Lname, Fname FROM Employees ORDER BY Fname;"
End If
If Me.cmbFirst.Value <> "" Then
strFilter = strFilter & " And [Fname] = '" & Me.cmbFirst.Value & "'"
End If
If cmbLast.Value <> "" Then
strFilter = strFilter & " And [Lname] = '" & Me.cmbLast.Value & "'"
End If
cmbFirst.Requery
cmbLast.Requery
Me.FilterOn = True
Me.OrderByOn = True
Me.Requery 'ADDED
End Function
also...please please PLEASE compact the database, and then run a test compile to see if this is an error that appears during the compilation process. if the compilation doesn't break because of this, your form object or file itself might be corrupted.