The following example is more or less the task that I'm actually doing, but with some irrelevancies removed. Suppose I have a table of surnames (the table is named Surnames) where each name is represented by a numeric code.
Surname ID
Jones 18573
Hall 27555
I want to use parameters to create coded descriptions for hyphenated names in this form: Jones-Hall is 18573 1 27555 2. The user should type in "Jones" as [Enter First Part] and "Hall" as [Enter Second Part] and have the computer look up the codes for those names and create the description. Obviously, this would be different from the description for Hall-Jones. So how would I write this query?
If I was choosing just one value from the table, to make "Jones" output to 18573 1, I think I would write
but I don't see how to choose multiple values in a fixed order.
Thanks for help!
Surname ID
Jones 18573
Hall 27555
I want to use parameters to create coded descriptions for hyphenated names in this form: Jones-Hall is 18573 1 27555 2. The user should type in "Jones" as [Enter First Part] and "Hall" as [Enter Second Part] and have the computer look up the codes for those names and create the description. Obviously, this would be different from the description for Hall-Jones. So how would I write this query?
If I was choosing just one value from the table, to make "Jones" output to 18573 1, I think I would write
Code:
SELECT Surnames.[ID] & " 1" AS Output FROM [Surnames] WHERE (([Surname] Like [Enter Name]));
but I don't see how to choose multiple values in a fixed order.
Thanks for help!