Combo values based on another combo value


Author
Message
Juan Carlos Pazos
Juan Carlos Pazos
StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)
Group: Forum Members
Posts: 144, Visits: 227
Hi

I have a form that shows two Combos and other controls.

The first combo displays a states lists (every state has an ID that is integer and the name), the combo shows only the name. This combo is filled by its own Bussines Object.

The second combo will only list the cities list according to the state selected in the first combo. Every citie has an ID, the ID_State, and the name the citie.

The form has a Bussines Object that is the one for the form, and that it's connected to the Cities table.

I have two problems here:

1) How can I filter the values of the second combo, I try using a FillByIDState where the SQL is "SELECT * FROM Cities WHERE IdState = @IdState" This is in the BO

In the form code I have this for the ComboBoxState_SelectedValueChanged event

Me.CitiesBO.FillByIDState(CInt(Me.ComboBoxState.ValueMember))

But not works.

2) The first combo (the one for the state) shows in Edit state, the other combo and the rest of the controls are protected.

Thanks for your help.

regards

Smile Everything is possible, just keep trying...

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search