Welcome! Log In Create A New Profile

Advanced

[WD24] How to do the impossible in a table - help please

Posted by Al 
Al
[WD24] How to do the impossible in a table - help please
November 12, 2020 07:31PM
Hello

I an looking for help / inspiration to create / edit data in a table using combo boxes but I can't figure out how to do it.

I have a job cost application. Jobs have cost budgets, cost budgets have cost categories
I am trying to create a cost record in a table and three of the columns are combo boxes containing a list of A jobs, B cost budgets and C cost categories.
The job selection A is simple, the complication is that the cost budget combo box B must only contain cost budgets for the job selected in combo box A and then after selecting the cost budget in combo box B, combo box C must only contain cost categories for the cost budget selected in combo box B. The data files, jobs , cost budgets and cost categories have numeric primary keys and are linked using those values as foreign keys in the child tables so the relationships are in place.

The task is how to fill the combo boxes after selections are made and how to keep that data when a new row is created in the table.
I can manage to get one row to work but after that, when I fill combos boxes B and C with job specific data, the values in the preceding row disappears and if the user just clicks in a previous combo box I can't fill it with the relevant data.


In terms of data volume a typical system might have between 5,000 and 60,000 plus jobs with each job having between 30 and 80 cost budgets and each cost budget having up between 4 and 8 cost categories so the child files can have significant numbers of records.

At the moment none of the cost budget or cost category information is in the table - they are in a panel to the side of the table and only the job is selected in the table.
I don't think the editing can be done in a table and the current method using the separate panel is working, so I am just looking for ideas please.


Regards
Al
Don't do it...

Have just the selected values from the combos visible in the table
When you want to edit a table line, just make a simple edit window appear on top of the current line (popup like) and do the input in there, then copy the values in the table. Simple, easy, and much more practical.
Al
Re: [WD24] How to do the impossible in a table - help please
November 12, 2020 07:53PM
Hello Argus

Thank you - that sounds quite workable - I will try your suggestion
Sometimes the problem becomes a mountain that obscures the way round it

Regards
Al
Ola
Re: [WD24] How to do the impossible in a table - help please
November 12, 2020 08:04PM
Hi Argus,

How do you place the editing window on top of the correct row?

Best regards
Ola
Al
Re: [WD24] How to do the impossible in a table - help please
November 12, 2020 08:13PM
Hello Ola

I am looking at using the mouse x and y co-ordinates to locate the edit window
I will do more work over the weekend here and post the results

Regards
Al
Re: [WD24] How to do the impossible in a table - help please
November 12, 2020 09:15PM
Hi Al,

you can also change the expanded-type of the combo to "popupwindow" and create a window which look just like a dropdown list..

Then in the "Opening the dropwdown list of combo xxx" use the OpenPopup() function to open that window. At this point you are able to pass parameters to that window, which would be the budgetcodes or categories for the current job.

When closing the window OpenPopup() will give you the returned value as in Close(MyWindow, nCategoryID)

This will also give you the opportunity to enhance the window with for let's saty a search dialog. Or use 2 different popupwindows.

Arie
Author:

Subject:


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.
Message: