A
Anne
I created a continuous subform (frmInventorySub) with 2 combo boxes
The first combo is a bound field called GhsSelect and the control Source is
GhseID.
the after update event is is follows
Private Sub GhsSelect_AfterUpdate()
Dim sBenchSource As String
sBenchSource = "SELECT [cboGHSbench].[ghBenchID],
[cboGHSbench].[GHHouseBenchNO],[cboGHSbench].[GhseID]" & _
"FROM cboGHSbench " & _
"WHERE [GhseID] = " & Me.GhsSelect.Value
Me.BenchSelect.RowSource = sBenchSource
Me.BenchSelect.Requery
End Sub
The second combo is call BenchSelect and the control Source is GHBenchID
Row source is:
SELECT [cboGHSbench].[GHBenchID],
[cboGHSbench].[GHHouseBenchNO],[cboGHSbench].[GHSEID]FROM cboGHSbench WHERE
[GhseID] = 2
which combes from the after update event of the first combo.
It works fine.
Now I created a main form (FrmInventory) and made frmInventorySub the
subform. I want to be able to select the greenhouse from a combo on the main
form..
Without making any changes to the subform, when I select one greenhouse from
the combo box on the main form, I loose the benches in my Benchselect combo
on the subform.
I actually should be able to convert the GhsSelect combo to a textbox on the
subform, because it is not needed there anymore. How do I filter the
Benchselect combo on the subform based on the combo on the main form?
Anne
The first combo is a bound field called GhsSelect and the control Source is
GhseID.
the after update event is is follows
Private Sub GhsSelect_AfterUpdate()
Dim sBenchSource As String
sBenchSource = "SELECT [cboGHSbench].[ghBenchID],
[cboGHSbench].[GHHouseBenchNO],[cboGHSbench].[GhseID]" & _
"FROM cboGHSbench " & _
"WHERE [GhseID] = " & Me.GhsSelect.Value
Me.BenchSelect.RowSource = sBenchSource
Me.BenchSelect.Requery
End Sub
The second combo is call BenchSelect and the control Source is GHBenchID
Row source is:
SELECT [cboGHSbench].[GHBenchID],
[cboGHSbench].[GHHouseBenchNO],[cboGHSbench].[GHSEID]FROM cboGHSbench WHERE
[GhseID] = 2
which combes from the after update event of the first combo.
It works fine.
Now I created a main form (FrmInventory) and made frmInventorySub the
subform. I want to be able to select the greenhouse from a combo on the main
form..
Without making any changes to the subform, when I select one greenhouse from
the combo box on the main form, I loose the benches in my Benchselect combo
on the subform.
I actually should be able to convert the GhsSelect combo to a textbox on the
subform, because it is not needed there anymore. How do I filter the
Benchselect combo on the subform based on the combo on the main form?
Anne