hi,

I have three comboboxes in my windows form. I want to relate them all with each other.

the data is coming from database a table which has the following columns:
id
description
ap code
seg code

now if user selects description then ap code and seg code should change to the same value for that specific description.

if user selects apcode then seg code and description should change to approperiate value.

same with seg code....

any help on how to start it and go about it....

thanks

Recommended Answers

All 7 Replies

populate each combobox with each table.
use key to search data in every table. so your table must be connected each other.
Now the question :

id
description
ap code
seg code

- it is your database and tables named is Id, Description, Ap Code, Seg Code (4 table) Or it is One Table with column named Id, Description, Ap Code, Seg Code (1 table-4 column) ???which one??

it is your database and tables named is Id, Description, Ap Code, Seg Code (4 table) Or it is One Table with column named Id, Description, Ap Code, Seg Code (1 table-4 column) ???which one??

hello,
It seems there is a 4-columns table. If this is true, SAM1 may use the selectedindexchanged event to set all combos selectedindexes to the changed combo one. Of course, all combos should be filled in the same order.

if there is 4 column in one table then you're right. as alemzadeh, use SelectedIndexchanged Event to get Key and search on table by the Key then display it in each combobox.

Hi,

Yes it was 4 columns and finally was solved thanks everyone

oh, you already solved that. please share with use how can it solved. so other member can learn many from you sam1.
And don't forget to mark this thread solved :)
thank you very much.

Can someone help me with the same one ? how do i develop an SQL query for that.. ? I have about 17 columns in my table but I want to link just 2 comboboxes in such a way that, when i choose combobox1, only related/applicable values get displayed on combobox2..

Thanks
KB

Hi Sam1
we are facing the same problem.
Could you please update ur running code if possible so that we can also solve it
with problems.


Thanks in Advance

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.