I have an owners table where there are 3 columns cnumber, cnumber2, cnumber3. When an owner logs in they choose which company they want to edit and that gets sent to a session variable called companyiD. How can I tell all my queries to pull only data that matches that companyID? In other words an owner may have 3 companies he chooses a company that is cnumber2. Rather than creating a column and companyID variable i want to have the query look at all 3 columns for that companyId and pull the values. Below is what i think might work but any help would be appreciated.
"Select * from gen_liability_form where Year_Completed = '" & ThisYear & "' and Session("CompanyID")IN (Select * from owners where cnumber, cnumber2,or cnumber3 = companyID)"