Combo box trouble

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
 
D

Douglas J. Steele

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"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top