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 
Referencing Combo Boxes in a Data Query
Don Gregory 
      
2 months ago
I have a parent form, a sub form, and a 2nd sub form within the 1st sub form. When using cascading combo boxes on the 2nd sub form, I try to reference the first combo box in my data query with Forms!Mainform!Subform1.Form!Subform2.Form!combobox, but its not working. I get the parameter prompt asking me to provide a value for the first combo box. Does this technique not work when you have a sub form within a sub form?
What should I be checking for? Is there something I should be doing differently?
Juan Rivera  @Reply  
            
2 months ago
Please show us what you are trying to do I think I understand but best to look and see how we can help best.  I have done forms with several combobox and requery to dwindle down to a specific item.  I am thinking this is what you are trying to do...

V/r
Juan
Raymond Spornhauer  @Reply  
          
2 months ago
Try using Me.Parent!Combobox

-Raymond
Don Gregory OP  @Reply  
      
2 months ago
The parent is a single form, the first sub form is a single form, and the second sub form is a continuous form. The three forms are linked-- parent to child, child to child with a case number. The 2nd sub form is embedded in the first sub form.
- There is a button on the parent form that opens the sub forms.
- The second sub form (referred to below as form 2) is the one where I am using cascading combo boxes.
- When the button is pressed on the parent form and sub form 1 is opened along with sub form 2, the first combo box works, but the 2nd combo box isn't working because its data query can't find the reference to the first combo box. I get a prompt after I have made selections in the two combo boxes.
- Using "Forms!Mainform!Subform1.Form!Subform2.Form!combo box" to refer to the first combo box in the 2nd combo box query didn't work. Is it supposed to work in SQL?
Juan Rivera  @Reply  
            
2 months ago
did you try Raymonds answer?  what happen?

V/r
Juan
Don Gregory OP  @Reply  
      
2 months ago
It didn't work. I tried leaving it as Me.Parent! followed by the Combobox name, as well as the actual name of the parent form. Neither one worked.
Is Me.Parent!Combobox supposed to be used in the query or someplace else?
Darrin Harris  @Reply  
     
2 months ago
Don Have you tried this, make a button to drop down the combo?

Forms!Mainform!Subform1.Form!Subform2.Form!combobox.SetFocus
Forms!Mainform!Subform1.Form!Subform2.Form!combobox.Dropdown

Your code seems to be correct
Forms!Mainform!Subform1.Form!Subform2.Form!combobox
Don Gregory OP  @Reply  
      
2 months ago
Darrin Would I use these in the on click event?

I also have questions about using Me.Parent.Combobox. My cascading combo boxes are located on the subform 2. There are no comboboxes on the parent form, so why would I be referencing a combobox on the Parent form-- or am I totally misunderstanding how Me.Parent.Combobox is supposed to work?

I've never heard of using Me in a data query. Didn't know that was even possible. I thought you had to give the full reference.
Darrin Harris  @Reply  
     
2 months ago
Don Yes you would use a button with a click event

I tried the parent didn't work for me.

I made the Mainform, Subform1, Subform2 and put Subform2 into Subform1 then add Subform1 to the Mianform.

So Forms!Mainform!Subform1.Form!Subform2.Form!combobox is correct, but what are you doing with it?

The button is just for testing to make sure your combo can be reached in Subform2 from the Mainform.
Don Gregory OP  @Reply  
      
2 months ago
My Subform1 is in the Mainform and Subform2 is in Subform1, just you've indicated above.

In my case, it's Forms!ClientDataControlF!CaseMgtF.Form!CaseMgtSub.Form!RefCatCBO. In the query design of the 2nd combo box on subform2, it's the criteria.

I will try to use the focus tip you suggested. Thanks!
Richard Rost  @Reply  
          
2 months ago
References to controls within nested subforms in query criteria can be tricky, especially with continuous forms. If you're still having problems, post some screenshots.

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: 4/30/2026 9:16:19 AM. PLT: 1s