I would like to create a query in Access that enables the user to enter the last name of a person and/or the first name and locates a record based on that criteria.
What I would like to happen is allow the user to enter a last name and a first name also if he/she wants to. For example, if the user enters a value for the last name, then the query will retrieve one or more records with a matching last name. However, if the user also enters a first name, then it will locate one or more records with both a matching last name and first name. The way the query is set up now, it will locate records that have both a matching last name as well as first name eventhough they may belong to different people. I do not want that. I realize I have to put the first name parameter in the criteria row next to the last name parameter, but if I did that, and the user did not enter any value for the first name, it won't return any records (because it is looking for a matching blank value for the first name).
How can I set it up so that it works the way I want it to?