Hi to all, I'm trying to get a query working that takes the values (sometimes just the first part of a string) from a form control. The problem I have is that it only returns records when the full string is typed in.
i.e. in the surname box, I should be able to type gr, and it brings up
green grey graham
but at present it's not bringing up anything uless the full search string is used.
There are 4 search controls on the form in question, and they are only used in the query if the box is filled in.
The query is :
SELECT TabCustomers.*, TabCustomers.CustomerForname AS NameSearch, TabCustomers.CustomerSurname AS SurnameSearch, TabCustomers.CustomerDOB AS DOBSearch, TabCustomers.CustomerID AS MemberSearch FROM TabCustomers WHERE IIf([Forms]![FrmSearchCustomer]![SearchMember] Is Null ,True ,[Forms]![FrmSearchCustomer]![SearchMember]=[customerid])=True AND IIf([Forms]![FrmSearchCustomer].[SearchFore] Is Null ,True ,[Forms]![FrmSearchCustomer]![SearchFore] Like [customerforname] & "*")=True AND IIf([Forms]![FrmSearchCustomer]![SearchLast] Is Null ,True ,[Forms]![FrmSearchCustomer]![SearchLast] Like [customersurname] & "*")=True AND IIf([Forms]![FrmSearchCustomer]![Searchdate] Is Null ,True ,[Forms]![FrmSearchCustomer]![Searchdate] Like [customerDOB] & "*")=True;