manix
Registered User.
- Local time
- Today, 07:05
- Joined
- Nov 29, 2006
- Messages
- 100
HI all,
I have a relatively straightforward filter working on a search form where a string is built based on the criteria entered in the form. Easy peasey while you have one Txt or Cmb box on the form each filtering through one filed in the records, but what if I want one txt box to filer through 4 fields in my table?
Here is the code I use to build the string. I want txtcustomer to look at 4 fileds on the table and return all the records that have the criteria entered in any of the 4 fileds. This code works OK looking at [customer 1] only, but I want it to look at [customer 1], [customer 2], [customer 3] & [customer 4], which are all fields in my table.
I have tried loads of different varients but none seem to work, can anybody help?
I have a relatively straightforward filter working on a search form where a string is built based on the criteria entered in the form. Easy peasey while you have one Txt or Cmb box on the form each filtering through one filed in the records, but what if I want one txt box to filer through 4 fields in my table?
Here is the code I use to build the string. I want txtcustomer to look at 4 fileds on the table and return all the records that have the criteria entered in any of the 4 fileds. This code works OK looking at [customer 1] only, but I want it to look at [customer 1], [customer 2], [customer 3] & [customer 4], which are all fields in my table.
Code:
If Not IsNull(Me.txtcustomer) Then
strWhere = strWhere & "([Customer 1] Like ""*" & Me.txtcustomer & "*"") AND "
End If
I have tried loads of different varients but none seem to work, can anybody help?