Form Referencing for Cascading Combos

Navyguy

Registered User.
Local time
Today, 06:31
Joined
Jan 21, 2004
Messages
194
Hello All

I have a series of cascading combos on a form that works great. Now I have a main form with some tab sheets that I want to use my cascading combos (now a subform) on and I get an error.

Should I be referencing the tabsheet or the main form name in my Row Source of my Combo.

Example: FrmMain is the main form name

SubFrmComboBoxes is the Sunform with the combos on it

TabForComboBoxes is the name of the tabsheet/controls on the main form

SELECT [Tbl-Gender].[GenderAutoNumberID], [Tbl-Gender].[Gender] FROM [Tbl-Gender] WHERE [Tbl-Gender].[AgeGroupAutoNumberID]=[Forms]![WHAT GOES HERE???]![CboAgeGroup] ORDER BY [Tbl-Gender].[GenderNumberID];

When I use the “SubFrmComboBoxes” the combos work great on their own SubForm, but not when I put them on the main form.

Thanks for all your help
 
You want to reference the subform from the contols name on the main form, and NOT what the subform is actually called.
Basically what this means is that on your main form you should have a subform control. Use that subform control's name to reference the subform.
So heres what you want:

SELECT [Tbl-Gender].[GenderAutoNumberID], [Tbl-Gender].[Gender] FROM [Tbl-Gender] WHERE [Tbl-Gender].[AgeGroupAutoNumberID]=[Forms]![frmMain]![subform_control_name]![CboAgeGroup] ORDER BY [Tbl-Gender].[GenderNumberID];

Hopefully thats what you need. I wasnt too sure if I read what you needed right. Just ask if its different.
Ta

Jason
 
That was exactly what I was looking for!!!

Thanks allot.
 

Users who are viewing this thread

Back
Top Bottom