0

well, tried using multiview.activeindex, does not work, tried using control.visible, does not work, here is my problem:

I have a dropdownlist with 4 items, by selecting a value, it should show me 4 different controls:

selected index 1: listbox1 - binds data to field A in table 1, but list is retrieved from table 2

selected index 2: listbox2 - binds data to field A in table 1, but list is retrieved from table 3

selected index 3: textbox 1 - binds data to field A in table 1, shows string1.

selected index 4: textbox 2 - binds data to field A in table 1, shows string2.

I need to buypass listbox2, text1, textbox2 if my dropdownlist index 1 is selected because otherwise I get errors like:

'ListBox2' has a SelectedValue which is invalid because it does not exist in the list of items.
Parameter name: value
How can I get this to work?

Additional info:
I use a master page.
I use formview
I use editformview
I use datasets

Thank you.

2
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by s627y
0

Put them in a select statement:

Select Case ddl.SelectedIndex
    Case 1 : 'code
    Case 2 : 'code
    Case Else : 'code if none found.
End Select
0

no, this will not work because you can't skip controls with that statement.

I've got it resolved, thank you though.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.