Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2013-01-17
2
Medium Priority
?
516 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
[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 48

Accepted Solution

by:
Dale Fye earned 2000 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 120

Expert Comment

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

master link field cboParts
child link field  [ProductLine]
0

Featured Post

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

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

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
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 …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

730 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