Welcome! Log In Create A New Profile


ComboBox help request

Posted by gga 
ComboBox help request
February 22, 2021 06:47PM
I an using WinDev 22 and I have a design problem which I will try to describe.
I want to have 2 ComboBoxes on an Edit Screen where the contents of the 2nd box depends on the content of the first.
The first is no problem: it is linked to a table which describes a type of component 1.Glass, 2. Resin, 3.Labour (and there might be more)
The contents of the 2nd Combobox will be based on either a Glass table, a Resin table, or a Labour table, etc. - a decision determined by what is selected in the first ComboBox.
What is the best way to do this?
Re: ComboBox help request
February 22, 2021 10:26PM

Queries as a source for your comboboxes is teh way to go forward...
You simply re-init the query of teh 2nd combo after a change to the 1st.


Peter H.
Re: ComboBox help request
February 22, 2021 10:27PM
There is no BEST WAY... there are many ways possible, and the choice depends on all the things you are NOT telling us, including what you prefer, fill more comfortable with...

So, you can, by example:
- Fill the combo by programming, depending on the content of the first combo
- map the combo with a file OR a query by default, along with a filter or parameters, and change the source and filter/parameter values depening on the first combo content
- ...
Re: ComboBox help request
February 24, 2021 05:00PM
It seemed rather complicated getting everything to work in both Edit and Add scenarios but I did come up with a solution which may not be very efficient but works. The tables involved are not very large so efficiency was not an important consideration.
I created 3 ComboBoxes in the same position but on different planes and selected the pane when the user enters that control based on the contents of the previous combobox. The saved values of all the comboboxes are ID's in the related tables so that meant I had an ID in the main table which might reference any of 3 files: using ScreenToFile produced weird results and so I just coded the Save manually.
Thanks for your input.

Your Email:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.