Solved

filter subform on unbound Combo box value access

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Suggested Solutions

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
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.

911 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