Hi all,
So I have this search filter that functions with a text field and button on a form. The code, which works, is as follows: The issue, however, is that when the filter is on, the data in the two fields that are actually subqueries in the recordsource query [expClientMainName] and [expClientFirstName] disappear. This is especially odd given that the search variant is actually searching those 2 fields. Thoughts?
Cheers, Tal.
Option Compare Database Option Explicit Private Sub btnClientSearch_Click() Dim varWhere As Variant
If Not IsNull(Me.txtClientSearch) Then varWhere = "([expClientMainName] LIKE ""*" & Me.txtClientSearch & "*"" OR " & _ "[expClientFirstName] LIKE ""*" & Me.txtClientSearch & "*"" OR " & _ "[txtGroupName] LIKE ""*" & Me.txtClientSearch & "*"")" End If
Me.Filter = varWhere Me.FilterOn = True End Sub
|
|