Howzabout instead using a multi-level form/subform/sub-subform
structure where the master/child relationship is set on the relation
between the form's 'phase' selector combo and the subform's 'phase'
foreign key?
That way you won't need to requery, the valid cBox2 values would be
filtered based on the relationship.
Similarly, each row of the sub-subform people list would be linked to
the selected record in the subform.
King Ron of Chi
I am not sure what you mean by:
> I can not requery combo box 2 based on the selection of combo box 1
> becuase of the complexity of the query to sort each phase. One table
> source and multiple criteria must me met in the query to pass to the
> next phase.
In order to tie the second combo box into the first combo box simply
refer to the first combo by its form field name (i.e. ME.cmbBox1) in
the source string for the second combo.
Here is a workable example (txtTelNo is the second combo, txtCarrier is
the first one):
Private Sub txtTelNo2_GotFocus()
Me.txtTelNo.RowSource = "SELECT First(tblNYUCircuitsServer.txtTelNo2)
AS [Carrier2 Telephone] FROM tblNYUCircuitsServer GROUP BY
tblNYUCircuitsServer.txtTelNo2 HAVING
(((tblNYUCircuitsServer.txtTelNo2) Is Not Null And Not
(tblNYUCircuitsServer.txtTelNo2)='') AND
((First(tblNYUCircuitsServer.txtCarrier2)) Is Not Null And
(First(tblNYUCircuitsServer.txtCarrier2)) LIKE '*" & _
me.txtCarrier & "*') AND
((First(tblNYUCircuitsServer.txtStatus))<>'Header')) ORDER BY
First(tblNYUCircuitsServer.txtCarrier2),
First(tblNYUCircuitsServer.txtTelNo2);"
End Sub
The first combo box name/variable (i.e. Me.ComboBox1) must be on a
separate line surrounded by single quotes:
Me.ComboBox2.Rowsource = "SELECT Table.Field2 FROM Table WHERE
Table.Field1 = '" & _
Me.ComboBox1 & "';"
> Hey everyone,
>
[quoted text clipped - 25 lines]
>
> Thanks in advance.
hmiller@hartford.edu - 16 Dec 2005 21:31 GMT
Hey guys,
Thanks so far for the help except I don't understand VBA, sorry.
However I got it to work through a marco. The macro wasn't allowing me
to use Select, but form your code I noticed that Select needed to be in
"". So thanks for the help guys.
Happy Holidays