No wonder this code is not working. The "Search" form does not have a RecordSource - it is unbound. Applying the filter string to that form's Filter property is meaningless.
If you want to construct the filter string and apply to another form or report. Try:
Code:
Private Sub Command164_Click()
Dim strFilter As String
If Me.Combo197 Like "Date*" Then
strFilter = Me.Combo197 & "=#" & Me.Text175 & "#"
ElseIf Me.Combo197 = "Report_ID" Or Me.Combo197 = "Submitted_By" Or Me.Combo197 = "Reviewed_By" Or Me.Combo197 = "Approved" Then
strFilter = Me.Combo197 & "=" & Me.Text175
Else
strFilter = Me.Combo197 & " LIKE '*" & Me.Text175 & "*'"
End If
DoCmd.OpenForm "SearchMainF", , , strFilter
End Sub
Be sure to fix the RecordSource of SearchMainF.
The Submitted_By, Reviewed_By, and Approved fields are number type but you have alias Lookups set up on them in table (I NEVER do that - review http://access.mvps.org/access/lookupfields.htm). Even though you see text when viewing the table the actual value is the foreign key number. The search parameter will have to be the foreign key number ID. More reason for a combobox to input search parameter instead of textbox.
Are you aware that Access has a 2GB file size limit? Embedding documents in Attachment field can use up that limit fast. Also, can't really filter/search an Attachment field, at least not with this arrangement.