Combo box trouble

  • Thread starter Thread starter Art Vandaley
  • Start date Start date
A

Art Vandaley

Hi,

(Access 2007)

I have two combo boxes which are unbound. I want 2nd combo box to show value
list according to the value of 1st combo box. As a sample:

If combo1 has value of 1 then combo2 should show list of 1001 and 1002.
If combo1 has value of 2 then combo2 should show list of 2001 and 2002.

I have below code:

--------------------------------------------------------------------------
Option Compare Database

If Combo1.Value = "1" Then
Combo2.RowSourceType = "TABLE/QUERY"
Combo2.RowSource = "1001;1001"
Else: Combo2.RowSource = "2001;2002"
End If
End Sub
 
You're not using Table/Query for the RowSourceType: you're using Value List.

Try:

If Combo1.Value = "1" Then
Combo2.RowSource = "1001;1001"
Else
Combo2.RowSource = "2001;2002"
End If
Combo2.RowSourceType = "Value List"
 
Back
Top