Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Cascading Combo Box in subform
Jennifer Abraham 
   
4 years ago
Hi folks
I have a invoicing Access DB for clinical trials. In my invoices form I have combo box called Protocol ID (these are clinical trial names), which comes from a Protocols table.

I have a subform in this form, called Invoice Details, linked by Invoice Number and ProtocolID, where a material is selected. Currently this is combo box pulling from the Materials table and all materials are available. Each material has a ProtocolID associated with it.  
I would like to make the materials available for selection in the subform  dependent on the protocol selected in the invoice form.
How do I do this?
Juan C Rivera  @Reply  
            
4 years ago
Hi Jennifer
I think there are several ways to do this.  Look at the Helper Table in the ABCD by making a choice you open up a list of options this may give you an idea.  Or just do in in query two fileds on the protocol and details filter the details based on protocol.
Let me know if this helps

Jennifer Abraham OP  @Reply  
   
4 years ago
Sorry Juan, you've lost me here..
I'm still very much a newbie. How can I share the DB with you so I can get a little more guidance?
Adam Schwanz  @Reply  
           
4 years ago
Usually we wouldn't do sharing databases Jennifer, see Forum Posting Rules Rule 5. That would be something more for the DevNet.

See Cascading this should help you out.
Adam Schwanz  @Reply  
           
4 years ago
You may also need to know Value From a Form depending on your setup if you're using a subform.
Juan C Rivera  @Reply  
            
4 years ago
When I mentioned the helper table I was thinking of how Richard had two tables set up.  So let's say table 1 has your protocols.  table two has Protocols and material.  Set up a filter on table two from the selection of table one.  this should just display the material for that protocol or query and criteria using a combo box...in my mind, I am thinking of how to do this but having a difficult time explaining it.  let me know if this helps.  can always set up a chat and walk you through it if you like.
Jennifer Abraham OP  @Reply  
   
4 years ago
Thanks Adam and Juan. I wasn't aware of the posting rules and don't want to upset anyone :)
I am sorry for the long post, but I am trying to be specific on the issue.

I have looked at the Cascade and Value From a Form videos, and I got part of the way there, but I am still having issues.

I have already successfully created a query (Invoice Query1) producing the correct values from the forms using the value from a form as the criteria.
I am pulling MaterialID (the index), MaterialName (the value required) and MaterialNumber (to display only) from the Material table and ProtocolID from the Protocols table.

In it I have MaterialID (the linked index, the Material Name (which I want to store in the invoice details subform and display) and Material Number (which I just want to display in the dropdown)) from the Materials table and ProtocolID from the InvoiceDetails table, with criteria [Forms]![Invoices]![ProtocolID]. (they are linked fields between form and subform).

When I create the combo box in the subform and try to use the query get the values, it brings up a message saying:
"When you select a row in the combo box, you can store a value from that row in your database, or you can use the value later to perform and action. Choose a field that uniquely identifies the row. Which column in your combo box contains the value you want to store or use in your database?"
Should this be the Material ID (the index) or the MaterialName (the actual value to be shown) field?

I then get the usual message of "Microsoft Access can store the selected value from your combo box in your database, or remember the value so you can use it later to perform a task. When you select a value in your combo box, what do you want Microsoft Access to do?"
I thought this should be the Material field (pls correct me if I am wrong), but it also adds to fields to the list called ProtocolID_Materials and ProtocolID_Materials1 to the list. I have no idea what these are..

If I select Material ID in the first message box, then store in Materials, it stores the index only. This creates 2 problems. First, the user can't type in the material name to select the option, they must use the dropdown selector. I have tried setting the column width to 0 for the index column as I have for my other cascading combo boxes, but then it blanks out the dropdown selections altogether!
Secondly, it is ugly for the user. As it is a datasheet view, I don't have the option to overlay a text field to make it pretty.. any thoughts on this would be appreciated.

If I select MaterialName in the first message box, then store in Materials, I get the "The value you entered isn't valid for this field..." and it won't let me select anything.

Any help you could offer here would be great. Thanks Jenny.
Jennifer Abraham OP  @Reply  
   
4 years ago
Further from this, I managed to produce the combo box with Material ID as the bound column and made column width 0.
It worked fine, until I shut the database down. When I reopened it, the dropdown now just shows 1 blank row.
How do I get it look for the query each time the DB fires up?

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/6/2026 4:35:07 AM. PLT: 1s