Solved

filter subform on unbound Combo box value access

Posted on 2012-03-23
2
633 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 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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.
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

749 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