Cascading Combo problem

sir_aingeal

Registered User.
Local time
Today, 07:55
Joined
Nov 5, 2002
Messages
21
I have form with 4 cascading combos on it. Both 3 & 4 are related back to No2. If I try and move the position or hide the bound field in either of them so that it cannot be seen by the user, I get a parameter box pop-up when the form is closed from a button, but not if it is closed by Xing out of it.

The SQL behind No3 is:

SELECT tbl_file_plans.[Sub-sub_Category], tbl_file_plans.[Sub-sub_Category_Title], tbl_file_plans.Subcategory, tbl_file_plans.Subcategory_Title, tbl_file_plans.Division, tbl_file_plans.ID
FROM tbl_file_plans INNER JOIN tblitems ON tbl_file_plans.Subcategory = tblitems.series
WHERE (((tbl_file_plans.Division)=1) AND
(([Forms]![frm_do_data_entry]![cboItems])=[tbl_file_plans]![Subcategory]));


I do not have this problem if I am going to a new record. I have tried putting a new record button on the form to get around this but even having moved to a new record I still get the same problem.

The line that wants the parameter is [Forms]![frm_do_data_entry]![cboItems]. But I only seem to have this problem if the form is maximized.


Any suggestions would be gratefully received.

Thanks
Iain
 
I have run into similar problems in the past. The only way I know of getting around it is to manually (ie through VBA code) set each control's recordsource as it's related parent is changed.

For Example:

Private Sub CONTROL1_AfterUpdate()
CONTROL2.RecordSource = "..." & _
"WHERE ABC = '" & CONTROL1 & "' "
CONTROL2.Requery
CONTROL3.RecordSource = ""
CONTROL4.RecordSource = ""
End Sub

Private Sub CONTROL2_AfterUpdate()
CONTROL3.RecordSource = "..." & _
"WHERE XYZ = '" & CONTROL2 & "' "
CONTROL3.Requery
CONTROL4.RecordSource = ""
End Sub

Private Sub CONTROL3_AfterUpdate()
CONTROL4.RecordSource = "..." & _
"WHERE XYZ = '" & CONTROL3 & "' "
CONTROL4.Requery
End Sub
 

Users who are viewing this thread

Back
Top Bottom