I have a table that has customer information. I am trying to do a query based "search". The table is basicly like this:
CustID | Full_Name | FST_NAME | LST_NAME
000001284585 | Smith John | John | Smith
000000025625 | Smith Jane | Jane | Smith
E1284585 | Web Jones | Web | Jones
CASH | Cash Acct | Cash | Acct
I would like the option to be able to search each of the above. If the person puts in Jane for a first name search, I want only the one, but if they put in Smith for the last name search, I want both. Same goes with the other feilds.
This is what I have now (This dosn't really work very well):
strSQLQuery = "SELECT * FROM CUST WHERE (((ucase(CUST.LST_NAM))='" & ucase(lookup) & "')) ORDER BY CustID"
I also have another table (items) that I want basicly the same searching idea. Search for the item number as well as the description.
Item # | Description
000000000000457 | Greenies
000000000256354 | T-shirt (256354001 - 256354111)
000000256354001 | Star Pattern T-Shirt
on this, if possible if the person types in 256354, I would like it to display 256354001 - 256354111, if not possible then just 256354001 - 256354
My main problem is the query statment it self. If any one can give me some pointers to point my in the right direction, thanks.
CustID | Full_Name | FST_NAME | LST_NAME
000001284585 | Smith John | John | Smith
000000025625 | Smith Jane | Jane | Smith
E1284585 | Web Jones | Web | Jones
CASH | Cash Acct | Cash | Acct
I would like the option to be able to search each of the above. If the person puts in Jane for a first name search, I want only the one, but if they put in Smith for the last name search, I want both. Same goes with the other feilds.
This is what I have now (This dosn't really work very well):
strSQLQuery = "SELECT * FROM CUST WHERE (((ucase(CUST.LST_NAM))='" & ucase(lookup) & "')) ORDER BY CustID"
I also have another table (items) that I want basicly the same searching idea. Search for the item number as well as the description.
Item # | Description
000000000000457 | Greenies
000000000256354 | T-shirt (256354001 - 256354111)
000000256354001 | Star Pattern T-Shirt
on this, if possible if the person types in 256354, I would like it to display 256354001 - 256354111, if not possible then just 256354001 - 256354
My main problem is the query statment it self. If any one can give me some pointers to point my in the right direction, thanks.