I've built a form with an embedded Subform. There are three combo boxes allowing the user to filter the results of the subform. Everything works until I embed the form onto the Navigation Form.
Code:
Option Compare Database
Option Explicit
Private Sub Combo9_Change()
Combo11.Value = Null
Combo11.Requery
Combo13.Value = Null
Dim SQL As String
SQL = "SELECT qry_Customers.[Major Command_ID], qry_Customers.[Major Command], qry_Customers.ComponentCommand_ID, qry_Customers.[Component Command], " _
& "qry_Customers.Commands_ID, qry_Customers.Command, tbl_TaskNames.[Task Name], tbl_TaskNames.[Task_ID], tbl_ChargeCodes.[Charge Code],tbl_ChargeCodes.[Contract Type], " _
& "tbl_ChargeCodes.[PoP Start], tbl_ChargeCodes.[PoP End], tbl_ChargeCodes.[Term Length], tbl_ChargeCodes.[Total Value], tbl_ChargeCodes.[Funded Amount], " _
& "tbl_ChargeCodes.[Cumulative Invoiced], tbl_ChargeCodes.[Funded Remaining], tbl_ChargeCodes.[Total Remaining], tbl_ChargeCodes.[Burn Rate] " _
& "FROM (tbl_ChargeCodes RIGHT JOIN tbl_TaskNames ON tbl_ChargeCodes.ChargeCode_ID = tbl_TaskNames.[Charge Code]) LEFT JOIN qry_Customers ON tbl_TaskNames.Customer = qry_Customers.Customer " _
& " WHERE ((tbl_ChargeCodes.[PoP End]) > Date()) AND qry_Customers.[Major Command_ID]=" & Me.Combo9 & " " _
& "ORDER BY tbl_ChargeCodes.[Charge Code];"
Me.frm_TaskNames_and_Customer1.Form.RecordSource = SQL
Me.frm_TaskNames_and_Customer1.Form.Requery
End Sub
As I stated this works when I open the form by itself but it doesn't work when the form is embedded in [frm_Navigation]
The location of the form in question on [frm_Navigation] is:
Tab: Search
Tab: Customer
The Customer tab contains [frm_ Sort Tasks by Customer]
[frm_Sort Tasks by Customer] contains the embedded Form [frm_TaskNames and Customer1]