Finally hit me - you are using a Navigation Form, not just form with Tab control.
Navigation Form presents different challenges when referencing subforms. Review https://www.accessforums.net/showthread.php?t=32053
And you add complexity with Navigation Form target objects that have their own subforms.
I don't like and have never used Navigation Form because of frustrations they provoke.
However, the form filtering you want to do is fairly simple and not really impacted by the use of Navigation form as none of the code requires referencing any subform behind other tabs.
Not seeing any VBA filtering code. Comboboxes and button are set to use [Embedded Macro]. I never use macros. Suggest you switch to [Event Procedure] and build VBA as per example already provided. Here's an example of a search form using VBA http://allenbrowne.com/ser-62.html.
Here's what I did to make the filtering work:
1. add [Department Code], [Finance Code], [Supplier ID], [Submitted By], [Send To] fields in query [Purchase details extended query]
2. change report [New POreport] RecordSource to [Purchase details extended query] (two-fold purpose: 1. no need for another query object and 2. eliminate the input popup prompt)
3. rename comboboxes to cboDep, cboBud, cboSup
4. change [Embedded Macro] to [Event Procedure] in the event property for comboboxes and button
5. rename subform container control [Purchase details extended subform] to ctrPurchases
6. VBA code behind [PO list with dept tabs and subform]:
Code:
Option Compare Database
Option Explicit
Sub cboDep_AfterUpdate()
FilterSub
End Sub
Sub cboBud_AfterUpdate()
FilterSub
End Sub
Sub cboSup_AfterUpdate()
FilterSub
End Sub
Private Sub Print_selection_Click()
DoCmd.OpenReport "New POreport", acViewPreview, , "[Purchase Order ID]=" & Me.ctrPurchases![Purchase Order ID]
End Sub
Sub FilterSub()
Dim sWhere As String
sWhere = "1=1"
If Not IsNull(cboDep) Then sWhere = sWhere & " and [Department Code]=" & cboDep
If Not IsNull(cboBud) Then sWhere = sWhere & " and [Finance Code]=" & cboBud
If Not IsNull(cboSup) Then sWhere = sWhere & " and [Supplier ID]=" & cboSup
If sWhere = "1=1" Then
Me.ctrPurchases.Form.FilterOn = False
Else
Me.ctrPurchases.Form.Filter = sWhere
Me.ctrPurchases.Form.FilterOn = True
End If
End Sub
Recommend not to use spaces nor punctuation/special characters (underscore only exception) in naming convention. Better would be DeptCode or Dept_Code.