Hi XMan
Either:
1) Set the ComboBox2's RowSource to:
Select CustID, CustName from CustTable where CustClass=Forms![Your
Form]![ComboBox1]
...and in ComboBox1_AfterUpdate say:
ComboBox2.Requery
or:
2) In ComboBox2_AfterUpdate say:
If IsNull(ComboBox1) then
ComboBox2.RowSource = ""
Else
ComboBox2.RowSource = "Select CustID, CustName from " _
& "CustTable where CustClass='" & ComboBox1 & "'"
End If
In either case, add the following to Form_Current:
Call ComboBox2_AfterUpdate
--
Good Luck!
Graham Mandeno [Access MVP]
Auckland, New Zealand
Return mail address is invalid in a vain attempt to reduce spam.
Feedback is welcome at: (e-mail address removed)
Please post new questions or followups to newsgroup.
XMan said:
I know this one has been asked a million times but I need an example for the
trick.
ComboBox2 query depends on ComboBox1 selected value.
ComboBox1 is Customer Class: A, B, C
ComboBox2 is Customer Name. These belong to selected Class.
TIA.