Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 650
  • Last Modified:

filter subform on unbound Combo box value access

I have a form with an unbound Combo Box that gets its value from a sql string,
I have a sub form SubfrmCAT_SUBResultsForAttrib that I want to filter by the value in the Combo box.  There is no parent child relationship between the sub form and the main form  because my controls are unbound, is there a way to filter the sub form as the value in the Combo box has a matching value in the sub form?

Main and Subform
0
skull52
Asked:
skull52
1 Solution
 
mbizupCommented:
Give this a try if subcat is numeric:

Me.SubfrmCAT_SUBResultsForAttrib.Form.Filter = "SUBCAT = " & Me.YourComboName
Me.SubfrmCAT_SUBResultsForAttrib.Form.FilterOn = True


If Subcat is TEXT:

Me.SubfrmCAT_SUBResultsForAttrib.Form.Filter = "SUBCAT = '" & Me.YourComboName  & "'"
Me.SubfrmCAT_SUBResultsForAttrib.Form.FilterOn = True


Use the AfterUpdate event of your combo box
0
 
skull52Author Commented:
mbizup,
Worked like a charm, I wasn't sure of the syntax because my main controls were unbound, thanks.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now