Very strange subquery field disappeared with a filter

T

Tal

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top