Combo boxes in a form

G

Guest

I have 3 combo boxes in a form. The first combo box is a "yes" or "no" value
list option. The second combo box has a value list with four choices but I
only want those four choices to show if the first combo box has "yes" select
if not it would be blank. The third combo box is a "yes" or "no" value list
option but I only want the "yes" or "no" to show if only a specific choice
was selected from the second combo box otherwise it would be blank. How would
I code this? Thanks in advance.
 
F

fredg

I have 3 combo boxes in a form. The first combo box is a "yes" or "no" value
list option. The second combo box has a value list with four choices but I
only want those four choices to show if the first combo box has "yes" select
if not it would be blank. The third combo box is a "yes" or "no" value list
option but I only want the "yes" or "no" to show if only a specific choice
was selected from the second combo box otherwise it would be blank. How would
I code this? Thanks in advance.

Set each combo box RowSource Type proprty to "Value List"
Set the first Combo Rowsource to "Yes";"No"
Leave each of the other Combo box Rowsource property blank.

Code the AfterUpdate event of Combi1:
If Me![Combo1] = "Yes" Then
Me![Combo2].Rowsource = "East;West;North;South"
Else
Me![Combo2].Rowsource = ""
End If


Similarly, code the AfterUpdate event of Combo2:
If Me![Combo2] = "West" Then
Me![Combo3].Rowsource = "Yes;No"
Else
Me![Combo3].Rowsource = ""
End If
 
G

Guest

The below coding didn't work. It didn't list "W-8ECI";W-8BEN;W-9;W-8IMY" in
my combo box named "cmbTaxFormonFile"This is how I entered it:
Private Sub cmbForeignBank_AfterUpdate()
If Me![cmbForeignBank] = "Yes" Then
Me![cmbTaxFormonFile].RowSource = "W-8ECI;W-8BEN;W-9;W-8IMY"
Else
Me![cmbTaxFormonFile].RowSource = ""
End If
End Sub
Thanks

fredg said:
I have 3 combo boxes in a form. The first combo box is a "yes" or "no" value
list option. The second combo box has a value list with four choices but I
only want those four choices to show if the first combo box has "yes" select
if not it would be blank. The third combo box is a "yes" or "no" value list
option but I only want the "yes" or "no" to show if only a specific choice
was selected from the second combo box otherwise it would be blank. How would
I code this? Thanks in advance.

Set each combo box RowSource Type proprty to "Value List"
Set the first Combo Rowsource to "Yes";"No"
Leave each of the other Combo box Rowsource property blank.

Code the AfterUpdate event of Combi1:
If Me![Combo1] = "Yes" Then
Me![Combo2].Rowsource = "East;West;North;South"
Else
Me![Combo2].Rowsource = ""
End If


Similarly, code the AfterUpdate event of Combo2:
If Me![Combo2] = "West" Then
Me![Combo3].Rowsource = "Yes;No"
Else
Me![Combo3].Rowsource = ""
End If
 
F

fredg

The below coding didn't work. It didn't list "W-8ECI";W-8BEN;W-9;W-8IMY" in
my combo box named "cmbTaxFormonFile"This is how I entered it:
Private Sub cmbForeignBank_AfterUpdate()
If Me![cmbForeignBank] = "Yes" Then
Me![cmbTaxFormonFile].RowSource = "W-8ECI;W-8BEN;W-9;W-8IMY"
Else
Me![cmbTaxFormonFile].RowSource = ""
End If
End Sub
Thanks

fredg said:
I have 3 combo boxes in a form. The first combo box is a "yes" or "no" value
list option. The second combo box has a value list with four choices but I
only want those four choices to show if the first combo box has "yes" select
if not it would be blank. The third combo box is a "yes" or "no" value list
option but I only want the "yes" or "no" to show if only a specific choice
was selected from the second combo box otherwise it would be blank. How would
I code this? Thanks in advance.

Set each combo box RowSource Type proprty to "Value List"
Set the first Combo Rowsource to "Yes";"No"
Leave each of the other Combo box Rowsource property blank.

Code the AfterUpdate event of Combi1:
If Me![Combo1] = "Yes" Then
Me![Combo2].Rowsource = "East;West;North;South"
Else
Me![Combo2].Rowsource = ""
End If

Similarly, code the AfterUpdate event of Combo2:
If Me![Combo2] = "West" Then
Me![Combo3].Rowsource = "Yes;No"
Else
Me![Combo3].Rowsource = ""
End If

It didn't show just the W-8CI or it didn't show any of 4 the choices?

I just ran your code:
Me![cmbTaxFormonFile].RowSource = "W-8ECI;W-8BEN;W-9;W-8IMY"
and it worked fine.
 

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