N
nybaseball22
Hello. I have been struggling with this project for over a week. I
think/hope I am almost done. I am using the below code on a main
form. I think everything is working properly except the apply
filter. I have one of 5 subforms open on a Form OnCurrent and "Type"
AfterUpdate. However, I want the apply filter to apply to what is in
the subform. I think it is applying to the Main form. I use the
subforms on several different forms, so I am trying to avoid having
the source for the subform be a filter based on the form that is open
because they all have different names (obviously).
Does anyone know how I can get the apply filter to work on the
subform?
Thank you very much.
If IsNull(Me.[Payee]) Then
Me.SubBillsChild.SourceObject = "subBillsMain"
Else
Select Case Me.Type
Case "Electricity"
Me.SubBillsChild.SourceObject = "subBillsElectricity"
DoCmd.ApplyFilter "subBillsNew", ""
Case "Oil"
Me.SubBillsChild.SourceObject = "subBillsOil"
DoCmd.ApplyFilter "subBillsNew", ""
Case "Cable/Telephone/Internet"
Me.SubBillsChild.SourceObject = "subBillsCable"
DoCmd.ApplyFilter "subBillsNew", ""
Case "Cellphone"
Me.SubBillsChild.SourceObject = "subBillsCell"
DoCmd.ApplyFilter "subBillsNew", ""
Case Else
Me.SubBillsChild.SourceObject = "subBillsMain"
DoCmd.ApplyFilter "subBillsNew", ""
End Select
End If
think/hope I am almost done. I am using the below code on a main
form. I think everything is working properly except the apply
filter. I have one of 5 subforms open on a Form OnCurrent and "Type"
AfterUpdate. However, I want the apply filter to apply to what is in
the subform. I think it is applying to the Main form. I use the
subforms on several different forms, so I am trying to avoid having
the source for the subform be a filter based on the form that is open
because they all have different names (obviously).
Does anyone know how I can get the apply filter to work on the
subform?
Thank you very much.
If IsNull(Me.[Payee]) Then
Me.SubBillsChild.SourceObject = "subBillsMain"
Else
Select Case Me.Type
Case "Electricity"
Me.SubBillsChild.SourceObject = "subBillsElectricity"
DoCmd.ApplyFilter "subBillsNew", ""
Case "Oil"
Me.SubBillsChild.SourceObject = "subBillsOil"
DoCmd.ApplyFilter "subBillsNew", ""
Case "Cable/Telephone/Internet"
Me.SubBillsChild.SourceObject = "subBillsCable"
DoCmd.ApplyFilter "subBillsNew", ""
Case "Cellphone"
Me.SubBillsChild.SourceObject = "subBillsCell"
DoCmd.ApplyFilter "subBillsNew", ""
Case Else
Me.SubBillsChild.SourceObject = "subBillsMain"
DoCmd.ApplyFilter "subBillsNew", ""
End Select
End If