How to filter a Query from multiple Forms?
Posted on 2008-11-04
I have a query called qryLoan that I am trying to filter. My query is filtered based on a form called frmReportGenerator. The user selects a combo box value (cboINVID) on this form. So to filter the query I use this code in the query criteria: [Forms]![frmReportGenerator]![cboINVID]. I would like the ability to filter my query from multiple forms. For example, my second form is frmViewGenerator and the user can select the combo box value (cboINVID), and I use this code in the query criteria: [Forms]![frmViewGenerator]![cboINVID]. But, the issue I run into is that the qryLoan prompts for both values when both criteria are entered in the query. I only want the query to prompt for the values based on the form that I'm using, since both forms will not be used at once. Note I'm trying to do this on a larger scale where I may have 5 different forms that could filter the same query. What is the best way to approach this?