Sue22
Registered User.
- Local time
- Today, 22:31
- Joined
- Mar 11, 2015
- Messages
- 37
Hi there I have a filter on a form :
There is a text box (txtSearchP) where the user will enter their search term then click button to apply the filter:
Private Sub cmdSearchP_Click()
' Filter by Programme Description
Me.Filter = [Programme_Desc] Like "*" & Me.txtSearchP & "*"
Me.FilterOn = True
Me.Requery
End Sub
This works fine but actually I want to search two fields for the text entered in txtSearchP [Programme_Desc] OR [Programme]
I've tried this but it doesn't work:
Private Sub cmdSearchP_Click()
' Filter by Programme Code and Description
Me.Filter = [Programme_Desc] Like "*" & Me.txtSearchP & "*" OR [Programme] Like "*" & Me.txtSearchP & "*"
Me.FilterOn = True
Me.Requery
End Sub
Can anyone help I have been banging my head against the wall for ages with this now I've 'googled' and can't find anything helpful that I can understand odd examples I found didn't work. I know I could give the users two text boxes and two Buttons one for each and this would work but I don't want the form to be cluttered and it needs to be idiot proof.
Thanks in advance
:banghead: :banghead: :banghead: 
There is a text box (txtSearchP) where the user will enter their search term then click button to apply the filter:
Private Sub cmdSearchP_Click()
' Filter by Programme Description
Me.Filter = [Programme_Desc] Like "*" & Me.txtSearchP & "*"
Me.FilterOn = True
Me.Requery
End Sub
This works fine but actually I want to search two fields for the text entered in txtSearchP [Programme_Desc] OR [Programme]
I've tried this but it doesn't work:
Private Sub cmdSearchP_Click()
' Filter by Programme Code and Description
Me.Filter = [Programme_Desc] Like "*" & Me.txtSearchP & "*" OR [Programme] Like "*" & Me.txtSearchP & "*"
Me.FilterOn = True
Me.Requery
End Sub
Can anyone help I have been banging my head against the wall for ages with this now I've 'googled' and can't find anything helpful that I can understand odd examples I found didn't work. I know I could give the users two text boxes and two Buttons one for each and this would work but I don't want the form to be cluttered and it needs to be idiot proof.
Thanks in advance