I don't get it, why are you repeating the same field twice in the query? What is [enter keyword] and why do you have two parameters for the same field? Also I don't get what the "or" line means at all? Try expressing your criteria and your parameter(s) in plain words first.
Where do you see that? One field is named No_ and the other is Name (name is a reserved word and should not be a field or object name).
This makes it a parameter query - user will get a prompt.What is [enter keyword]
The second line is asking for all records where vendor is Null. However, the or is declared at the left side of the grid - you do not add it to the criteria.and why do you have two parameters for the same field? Also I don't get what the "or" line means at all?
Second, you don't use Like with Null or Is Null. Like is a comparison operator and there is nothing to compare if the field is Null. Like is for criteria with wild cards.
Last edited by Micron; 10-30-2016 at 12:51 PM. Reason: clarification
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.
Thank you for your reply. for further clarification, for eg: i have 4 vendors named 1) abcvendor 2) cdevendor 3) fgevendor 4) abcdvendor . when i click run button a prompt will ask [enter vendor no ] , if i leave blank another prompt will pop up to [enter keyword] then i will enter "abc" so it will display only a vendor with letter abc , the result must be vendor no 1 and 4, but in this scenario i am getting a result that showing all the 4 vendors which i have. Anyone please suggest appropriate query.
Try pasting this into a new query
Note the single quotes within the double quotes. This assumes the first prompt expects a number and the second is text.Code:SELECT [No_], [Name] FROM [dbo_Wear Mart Warehouse$Vendor] WHERE [dbo_Wear Mart Warehouse$Vendor].[No_] = [ENTER VENDOR NO] AND [dbo_Wear Mart Warehouse$Vendor].[Name] Like "'*" & [enter keyword] & "*'";