?
Solved

filter subform on unbound Combo box value access

Posted on 2012-03-23
2
Medium Priority
?
643 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 61

Accepted Solution

by:
mbizup earned 2000 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

777 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