I am currently trying to get the second criteria working and have been poking around on this and other forums. This is my code:
Code:
Private Sub FindRecordsbyCompany_Click()
On Error GoTo FindRecordsbyCompany_Click_Err
DoCmd.RunCommand acCmdSaveRecord
Dim whereStmt As String
whereStmt = ""
If Not IsNull(Me.TenantCompany) Then
whereStmt = "[TenantCompany] = & Me.TenantCompany & " And ""
End If
If Not IsNull(Me.Status) Then
whereStmt = "[Status] = & Me.Status"
End If
whereStmt = Left(whereStmt, Len(whereStmt) - 5)
DoCmd.OpenReport "RecordsbyCompanyR", acViewPreview, "", whereStmt
FindRecordsbyCompany_Click_Exit:
Exit Sub
FindRecordsbyCompany_Click_Err:
MsgBox Error$
Resume FindRecordsbyCompany_Click_Exit
End Sub
But when I attempt to run it, I get a "type mismatch" error from Access...any ideas?