I have a module that allows users to print data to a Word template. As a complication, this action needs to be called from two forms.
Normally, this wouldn't be an issue but users can further filter their selected data via an option group, which stores 2 radio buttons (1=Pass, 2=Fail).
My module works in the first form because I have an IF statement that calls it directly. Here is a code snippet from the module:
If [Forms]![CustFilter].[optgrpStatus] = 2 Then
strSQL = "SELECT qryWordReport.tcID AS ID, qryWordReport.tcDescription AS Description, " & _
"qryWordReport.TestObjective AS [Test Objective], qryWordReport.CompletionCriteria AS [Completion Criteria], " & _
"qryWordReport.ProductRequirement As [Product Requirement] " & _
"FROM qryWordReport"
ElseIf [Forms]![CustFilter].[optgrpStatus] = 1 Then
'returns TCs that have a 'Pass' status
strSQL = "SELECT qryWordReport.tcID AS ID, qryWordReport.tcDescription AS Description, " & _
"qryWordReport.TestObjective AS [Test Objective], qryWordReport.CompletionCriteria AS [Completion Criteria], " & _
"qryWordReport.ProductRequirement As [Product Requirement] " & _
"FROM qryWordReport " & _
"WHERE qryWordReport.tcStatus = 1"
End If
My problem is that the second form ([CustFilter_Print]) also needs to call this module and needs to use a similar statement to determine what option is set to True within the option group. Both forms call the Module with the following:
Call PrintCustReportWithWord
Is there some way to identify which Form is calling the module? If so, that would simplify my process... Or is there some other solution that I am overlooking?
Any help, as always, would be greatly appreciated.
Normally, this wouldn't be an issue but users can further filter their selected data via an option group, which stores 2 radio buttons (1=Pass, 2=Fail).
My module works in the first form because I have an IF statement that calls it directly. Here is a code snippet from the module:
If [Forms]![CustFilter].[optgrpStatus] = 2 Then
strSQL = "SELECT qryWordReport.tcID AS ID, qryWordReport.tcDescription AS Description, " & _
"qryWordReport.TestObjective AS [Test Objective], qryWordReport.CompletionCriteria AS [Completion Criteria], " & _
"qryWordReport.ProductRequirement As [Product Requirement] " & _
"FROM qryWordReport"
ElseIf [Forms]![CustFilter].[optgrpStatus] = 1 Then
'returns TCs that have a 'Pass' status
strSQL = "SELECT qryWordReport.tcID AS ID, qryWordReport.tcDescription AS Description, " & _
"qryWordReport.TestObjective AS [Test Objective], qryWordReport.CompletionCriteria AS [Completion Criteria], " & _
"qryWordReport.ProductRequirement As [Product Requirement] " & _
"FROM qryWordReport " & _
"WHERE qryWordReport.tcStatus = 1"
End If
My problem is that the second form ([CustFilter_Print]) also needs to call this module and needs to use a similar statement to determine what option is set to True within the option group. Both forms call the Module with the following:
Call PrintCustReportWithWord
Is there some way to identify which Form is calling the module? If so, that would simplify my process... Or is there some other solution that I am overlooking?
Any help, as always, would be greatly appreciated.