Topic: Big project requires some help :)

Hi there,

I have a big project on the table and I just wonder how to figure out some specific user requirements such as the ability to choose in a list what kind of information to add in a table...

example given:

I have 10 tables, let's call them T1, T2, T3....T10.

Most of these table require separate feedings and the user would like to avoid to clutter the user interface (which is ergonomic), thus they want to see one drop list to chose which information to add and then, get the correct feeding form.

BUT....(on top of that) some information must be linked together so if one information is added in a table, I must be able to select the linked information as well. My brain is starting to hurt.

If I need to add data in T2, it must also be related to T1 and/or T3

I have attached a picture of current schema, I am looking for scripts or forms or any kind of help.

Post's attachments

Attachment icon Project_SDC.png 67.94 kb, 380 downloads since 2015-05-29 

Re: Big project requires some help :)

Hi TCoton,
Perhaps you could add a 'USERS' table with 2 fields (UserName, UserGroup).
Then you could restrict access to various sub-sets of tables conditional upon each UserGroup.
For example,
if UserGroup = 'A' then
        form1.tablegrid3.visible:= false;
        form1.tablegrid7.visible:= false;
If UserGroup = 'B' then
        form1.tablegrid2.visible:= false;
   and so on
I've tried something a bit similar before - but not as complicated as your project.  But the theory is the same.
Good Luck.
Derek.

Post's attachments

Attachment icon tc.jpg 117.03 kb, 364 downloads since 2015-05-29 

3 (edited by tcoton 2015-05-29 20:05:01)

Re: Big project requires some help :)

Hi Derek,

thanks for the hint this is part of the user requirement, separate permission, thanks for the input.

I still struggle with the "simple" user interface where people would input data by simply choosing a category in a drop down list to add data in the chosen list. To me it is a mistery...

I could create a very basic interface to input data but still the fancy feature escape to my current knowledge

Re: Big project requires some help :)

To be clear with this subject, it is regarding a pharma dev center for a major pharma group... They just struggle in finding the right information correlated with another one... thanks to Excel spreadsheets (like ....shxt)

Re: Big project requires some help :)

I believe that what you want to use from your description are triggers.
They would work such that when the suer inputs certain data to populate fields in one table, that the triggers would activate and automatically populate some of the same data into other related tables.
The problem is that currently MVD does not support triggers directly, and they will have to be added using a 3rd party tool (I understand that SQLiteStudio has been the recommended tool mentioned in this forum before).

Note: Looking at some previous posts, it looks like you are already using this tool along with triggers for other parts of your project, so this shouldn't be new to you; you just have to expand on what you have already and make sure you populate the related tables correctly with the information you obtain from the user. cheers.

Dennis

6 (edited by tcoton 2015-05-31 16:08:40)

Re: Big project requires some help :)

Hi,

actually, I am looking for a way to be able to choose from a droplist which form to display when the user wants to input data in a specific field.


It would be like a combobox referring to a form in the project. Doing so, it would limit the input errors.

Let say on home page, I have a search engine and a button "ADD", when clicking on "ADD", I would like to be able to choose which information to add using a droplist , then click, OK and the proper form displays.

To give you an idea of how I am drawing it currently, please see attached picture. Each line on the screenshot is a separate information, links are made using keys in DB.

Post's attachments

Attachment icon Input_raw_data.png 41.39 kb, 338 downloads since 2015-05-31 

Re: Big project requires some help :)

Another question is, how to query information using results displayed in a grid on same form? I already use the script to get the info from a textbox but here, I am stuck.

In short, how to get info in Grid 2 (query in table X) based on information stored in Grid 1 (using query in table Y) sharing an id.key in Grid 1

Grid 1                        Grid 2


A                               Blue
B                               Green
C                               Yellow
D                               Red
E                               Cyan

Re: Big project requires some help :)

what you have in the picture seem to be on the right track; you just have to make sur that the raw data that the suer enters is as complete as possible and make sure the data flows (is saved) in the right tables with the correct linkages (primary and foreign keys).

as to your last question, the basic idea is as follows (the actual code/mechanics may not be correct and you will have to determine the actual correct syntax):

each grid/table/query should have a primary key associated with the data.
Grid 1                       Grid 2
key1  value              key2  fkey   value    <--- source table/query
1       A                       1        2        Blue
2       B                       2        4        Green
3       C                       3        3        Yellow  <-- this is a an example record that would be displayed in the Grid 2
4       D                       4        2        Red             based on the selection of "C" from Grid 1.  Other rows are shown
5       E                       5        4        Cyan           as examples of other possibilities that will not be included.

so that when the user select a row from Grid 1, say "C", then the key (or index) can be found, i.e. 3 and then using this key, we looks this up in the other Grid (2) using this key as the foreign key (fkey) to get the key/index of this data.

so after a selection ("C") is made in Grid 1, we have key1 = 3; Grid 2 data is dynamically generated using a query similar to:

select * from Table 2 where fkey = 3

I have used only simple Tables above as an illustration, but the data can come from other queries as well, however in a normalised database where each type of data (e.g. patient, results, test, etc.) should be in it's own table and if it is required elsewhere then it is referenced by it's table and key (like we were discussing in the above earlier posts).

Dennis

Re: Big project requires some help :)

but how do I retrieve the information in Grid 2 whitout selecting a row in grid 1.

I would like an automatic display of all requested information in different grids but I do not know how to get it working.

I use a script to retrieve information based on a TextBox, how could I do the same with a grid?

10 (edited by mr_d 2015-06-01 09:10:12)

Re: Big project requires some help :)

I'm not sure what you mean by getting data in grid2 without selecting any data in grid1.  isn't the point is that you do select some data in grid1 and the related data is displayed in grid2?
automatic display of data must start from somewhere. if it's from your textbox, then that's fine, otherwise it can be from another grid as well (i.e. the selected row).
there is a function/property of the grid control that allows you to determine the actual row selected by the user.
using this will allow you to get back the underlying data (keys, values, etc.) relate to that row of data.

edit: check out the properties "SelectedRow" (or "dbItemID") & "SelectedColumn" from the online help.

Dennis

Re: Big project requires some help :)

It is very tricky actually to get multiple information which are linked by a key from different sources and display the required information separately.

It is much easier in a simple grid with an SQL query but here, the information must be displayed separately to get clear information on each level.



Please find a picture of what I mean by getting information from another grid automatically, the arrow indicates the source of the information (the key)

Post's attachments

Attachment icon getting_info_from_diff_sources.png 49.93 kb, 339 downloads since 2015-06-01 

Re: Big project requires some help :)

Hi tcoton, I agree that there are cases that it may be very difficult to get separate related data to display in their own section if the relationships between them is unclear or too complex; I do not believe that it will ever be impossible (again as long as tall the data is related to each other in some way).
With your example picture (which helps a lot, so thanks for providing it), the following would be what I would do:
1. make sure that each grid data source represents either a single simple table or a simple query that has already been identified and created to contain only the data that is specific to the category (of the grid name).
2. make sure that each grid data source contains it's own primary key (which is assumes to be a single index number) for it's own data, as well as a field that represents the foreign key of it's parent data. so for e.g. the "Partners" grid would contain partner data and each row would have a unique partner_id (primary key) and a study_no_id (foreign key) among other data related to partners.  Similarly, the "Product Batch Number" grid would contain product batch data and each row would have a unique product_batch_id (primary key), a study_no_id (foreign key), and an analytical_request_id (foreign key) among other data related to product batches.
3. make sure that each grid shows only the data related to it's parent data which has been filtered recursively back until the initial source data of the "Study Number".
4. so to summarise, the following would be the expected data source queries for each or the data grids you have shown (with "Study Number" being the only known requirement/limiter as is assumed that the id is the same as the actual study number):
"Study Number" Textbox --> study_no
"Study Proto" Grid --> select * from study_proto_table where study_no_id = study_no
"Partners" Grid --> select * from partners_table where study_no_id = study_no
"Study Reports" Grid --> select * from study_reports_table where study_report_id = study_no
"Analytical Requests" Grid --> select * from analytical_requests_table where study_no_id = study_no
"Product Batch Number" Grid --> select * from product_batch_number_table where study_no_id = study_no and analytical_requests_id = analytical_requests_grid.analytical_requests_id
"API Batch Number" Grid --> select * from api_batch_numbers_table where product_batch_number_id = product_batch_number_grid.product_batch_number_id
5. make sure that whenever the "Study Number" textbox is changed, that the child grids will have to be updated in sequence of the relationship chain.
I hope this explains what I was getting at in my previous posts.  It may still be confusing or not explained properly; but I'm happy to help if you run into any problems with trying to implement this.  cheers.

Dennis

Re: Big project requires some help :)

Good Evening Tcoton,
When i saw the screenshot in your earlier post, i thought the structure looked like something i was working on a while ago (but with not so many tables!).
So i copied, cut and pasted the basics of that project, changed a few labels etc and have attached it.
I was in a hurry so it isn't very well laid out and the data is just rubbish - sorry for that!
Maybe you will find it helps a little bit.
Derek.

Post's attachments

Attachment icon studies.zip 338.61 kb, 641 downloads since 2015-06-02 

Re: Big project requires some help :)

Hi everyone,


@mr_d, the idea is there, I couldnot see any other option up to now and I wrote some scripts to achieve a beta version which, at least retrieves the correct information.

@derek, the use of the "Form1_TableGrid4_OnClick" procedure, a mix of search between grids and buttons and hidden comboboxes is very clever, I did not know these properties as it would have saved me a lot of time writing scripts. I will try to implement these features the best I can as quickly find the right info is the aim of this application. Thanks a lot.


My main concern would still to create some kind of wizard when it comes to input raw data to avoid people entering the wrong information into the wrong field.

The algorithm I imagine is:

User clicks on "Add" ---> pop-up with whether a droplist or radio button to select 1 kind of information ---> proper form displayed

I guess it can only be done by scripts but I am not affraid smile

Re: Big project requires some help :)

Hi Again TCOTON,
Just a thought - to give the effect of a User clicks 'add' ----> pop-up with a droplist,  could you instead click 'add' ----> call a form which contains menu buttons which, when clicked,  then show different forms depending on what you need to do? (please see attached).
Derek

Post's attachments

Attachment icon linkmenus.zip 335.35 kb, 659 downloads since 2015-06-03 

Re: Big project requires some help :)

Hi Derek,

the idea is there, thanks for the project.

The best would still be the "Wizard" mode where the user is guided through steps to limit input errors. I got feedbacks from the users after a beta release that there would be more tables, relations and fields needed...