I am using Access 2010 on Windows 7 x64 and my database is based off of the Products Web Database from Office.com.
I would like to be able to search for a product using any of the fields that are in the 'Products' table.
I attempted to follow this tutorial video but I couldn't get it to work properly - whenever I tried to run the query, I didn't get any results unless I filled in the first field. None of the other fields had any effect. Unfortunately, I can't post the SQL source because this is a Web query, but I have attached a screenshot and have posted further details below.
Form "SearchProducts"
Eight fields are selected to correspond with what I want to search. Each is named appropriately (see screenshot). Also has a submit button which I can't get to work. I can't find a way to get the button to open the query datasheet view. I searched and many people suggested having the button use a macro (which I have to because I'm in a web database) to display the report view, but I want datasheet view.
Query "SearchProducts"
Eight fields are selected to correspond with what I want to search. Each has a criteria, per the video, of the following:
Code:
Like "*" & [Forms]![SearchProducts]![txtProductCode] & "*"
Like "*" & [Forms]![SearchProducts]![txtProductName] & "*"
Like "*" & [Forms]![SearchProducts]![txtManufacturer] & "*"
Like "*" & [Forms]![SearchProducts]![txtMPN] & "*"
Like "*" & [Forms]![SearchProducts]![txtSupplier] & "*"
Like "*" & [Forms]![SearchProducts]![txtSPN] & "*"
Like "*" & [Forms]![SearchProducts]![txtCategory] & "*"
Like "*" & [Forms]![SearchProducts]![txtLocation] & "*"
I tried both configurations as seen in these screenshots - all criteria in the "criteria" field or the first one in criteria and the rest in "or".
I feel like it's something simple that I'm missing, but I could be wrong. As I mentioned above, I'm not limiting myself to this specific tutorial. I'm open to any suggestions as to how I can accomplish my goal of searching these eight fields in this table and filling in any number of fields and still getting a result if one is there.
Please let me know if you need more information!
Edit: I have started putting in the fields one-by-one into the Criteria instead of "or" and I have had more luck. For fields "ProductCode" through "SPN" everything works fine. If I try to search by category, I get results from many different categories instead of the one that I want.
One glitch with searching by Manufacturer is that you have to enter the Manufacturer ID number (primary key - ID in table) instead of the name. How can I make it search with the name?