Solved

filter subform on unbound Combo box value access

Posted on 2012-03-23
2
617 Views
Last Modified: 2012-03-23
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
Comment
Question by:skull52
2 Comments
 
LVL 61

Accepted Solution

by:
mbizup earned 500 total points
ID: 37758786
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
 

Author Comment

by:skull52
ID: 37759168
mbizup,
Worked like a charm, I wasn't sure of the syntax because my main controls were unbound, thanks.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now