Solved

Need Help Filtering Combox box on Subform with Data in Combobox on Main form

Posted on 2013-01-17
2
485 Views
Last Modified: 2013-02-15
I am trying to filter a combobox by running a query that contains the data from a combobox on the parent form. How can I reference the Parent forms combobox's value in my query?

Current Query to select all records
Select Part From PartList

I would like to be able to reference the combobox on the parent form so I can do this:
Select Part From PartList where ProductLine = 'PL'

I have attached a screenshot of the form. It is currently an Access 2010 ADP.
screenie.png
0
Comment
Question by:tekkieguru
2 Comments
 
LVL 47

Accepted Solution

by:
Dale Fye (Access MVP) earned 500 total points
ID: 38789078
Select Part From PartList where ProductLine = Forms!ParentFormName.cboParts

The problem you will have is that the subform actually loads before the main form, so when the subform trys to evaluate this SQL statement, the Parent forms cboParts will not contain a value, and may generate an error.

For this reason, I generally leave the subforms SourceObject property blank, then in the Main forms "Load" event, I will set the subforms SourceObject.

HTH
Dale
0
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 38789211
have you tried setting the master/child link fields

master link field cboParts
child link field  [ProductLine]
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
I have a large data set and a SSIS package. How can I load this file in multi threading?
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

943 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

5 Experts available now in Live!

Get 1:1 Help Now