Solved

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

Posted on 2013-01-17
2
476 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained 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

19 Experts available now in Live!

Get 1:1 Help Now