Background: A report (Final Report) uses a query as it's data source. This query (qryFinal) consists of (qryPart1) and (qryPart2). qryPart2 and qryFinal both require the same criteria on the field API ([Forms]![frm_Completions and Perfs]![Well ID]). This orginates from a user selected combo box. I need this in both queries for the report to work correctly.
Problem: I would like the user to be able to run this report from multiple forms independently using a cmd button on each form and having the criteria coming from a combo box on the same form.
It is possible that multiple forms could be open within the application and with different Well ID being displayed in their respective combo boxes on the different forms.
Question: [highlight]How can I get the two queries to respond based on the combo box value from the specific form from which the on click event occurred?[/highlight] Using multiple lines in the Criteria could generate undesired results if multiple forms are open with different values.
[highlight]Is there a way to identify the form from which the on click event occurred and use an IIF statement for the criteria value?
Is there any difference on how I should write the criteria that refers to qryPart2 vs qryFinal?[/highlight]
Problem: I would like the user to be able to run this report from multiple forms independently using a cmd button on each form and having the criteria coming from a combo box on the same form.
It is possible that multiple forms could be open within the application and with different Well ID being displayed in their respective combo boxes on the different forms.
Question: [highlight]How can I get the two queries to respond based on the combo box value from the specific form from which the on click event occurred?[/highlight] Using multiple lines in the Criteria could generate undesired results if multiple forms are open with different values.
[highlight]Is there a way to identify the form from which the on click event occurred and use an IIF statement for the criteria value?
Is there any difference on how I should write the criteria that refers to qryPart2 vs qryFinal?[/highlight]