N
NickDV
Hello,
I am trying to use the same unbound text box on a form to be used to
filter multiple fields. But I can not get it to work. The form has an
unbound text box called txtSubject and I would like to use it to
filter records in both the [Subject] field as well as the [Issue]
field. Actually I would like to use it on more fields, but this will
do for me to get the idea and to illustrate the problem.
Here is an example
'---------------------
'This ads the search for anything in the subject field
If Not IsNull(Me.txtSubject) Then
sFilter = IIf(sFilter <> "", sFilter & " and ", sFilter)
sFilter = sFilter & "[Subject] Like ""*" & Me.txtSubject & "*"""
End If
'---------------------
'This ads the search for anything in the Issue field but not
working in combo with subject
If Not IsNull(Me.txtSubject) Then
sFilter = IIf(sFilter <> "", sFilter & " and ", sFilter)
sFilter = sFilter & "[Issue] Like ""*" & Me.txtSubject & "*"""
End If
'-----------------------
Any sugestions on how to combine these two without having to create a
seperate text box for the [Issue] field would be appreciated.
Thanks
I am trying to use the same unbound text box on a form to be used to
filter multiple fields. But I can not get it to work. The form has an
unbound text box called txtSubject and I would like to use it to
filter records in both the [Subject] field as well as the [Issue]
field. Actually I would like to use it on more fields, but this will
do for me to get the idea and to illustrate the problem.
Here is an example
'---------------------
'This ads the search for anything in the subject field
If Not IsNull(Me.txtSubject) Then
sFilter = IIf(sFilter <> "", sFilter & " and ", sFilter)
sFilter = sFilter & "[Subject] Like ""*" & Me.txtSubject & "*"""
End If
'---------------------
'This ads the search for anything in the Issue field but not
working in combo with subject
If Not IsNull(Me.txtSubject) Then
sFilter = IIf(sFilter <> "", sFilter & " and ", sFilter)
sFilter = sFilter & "[Issue] Like ""*" & Me.txtSubject & "*"""
End If
'-----------------------
Any sugestions on how to combine these two without having to create a
seperate text box for the [Issue] field would be appreciated.
Thanks