Hello.
I am trying to create a query that refers to columns in a table. The parameters of this query will be displayed in a form.
I have a form called FrmAlpha. frmAlpha contains one Lookup field that is linked to tblMain. tblMain has three columns. Column(0) lists the name of a product. Column(1) lists an alternative spelling of the name. Column(2) lists another alternate spelling.
When I click a button on frmAlpha, I want it to run a query called qryAlpha.
This query looks for a number of fields across another table. However, I want to pull data only regarding the "Product." However, because of the alternative spellings of my products, I need to be able to search all alternative names at the same time. Therefore, my query would look something like this:
SELECT tblMain.Product, tblMain.NameVariant1, tblMain.NameVariant2
FROM tblMain
WHERE (((tblMain.Product)="~~~ProductName~~~")) OR (((tblMain.NameVariant1)="~~~AltName~~~")) OR (((tblMain.NameVariant2)="~~~AltName2~~~"));
I want to replace ~~~ProductName~~~, ~~~AltName~~~ and ~~~AltName2~~~ with something like: That refers to my frmAlpha lookup field which re-refers to a specific column in my table.
I hope that makes sense...