From: Art Vandaley on
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
--------------------------------------------------------------------------

This is not working. Combo2's list is always blank. What should I Do?

Help Please.


From: Douglas J. Steele on
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"


--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Art Vandaley" <kestafir(a)hotmail.com> wrote in message
news:ORzhIPG4IHA.4988(a)TK2MSFTNGP04.phx.gbl...
> 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
> --------------------------------------------------------------------------
>
> This is not working. Combo2's list is always blank. What should I Do?
>
> Help Please.
>