[Solved] Getting filter in the form

Creating and using forms
Post Reply
syp1977
Posts: 31
Joined: Thu Apr 08, 2021 7:58 pm

[Solved] Getting filter in the form

Post by syp1977 »

I am new to dbase.
I tried to make form for input of raw data for my study.
I have made separate table for condition and sub-condition.
I have form with drop down menu for selection from the menu.
My intention is, once I make selection for specific condition and then I select specific sub condition, it should only show subscondition specific to condition.

Can this be done.

I have attached file for reference.

Regards,
SP
Attachments
Study_Flex_studies.odb
Data input for experiment
(28.16 KiB) Downloaded 229 times
Last edited by syp1977 on Wed Dec 29, 2021 9:53 am, edited 3 times in total.
OpenOffice 4.1.2 on Windows 10
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Getting filter in the form

Post by Villeroy »

This database is faulty. Forget about filter forms until you implemented your one-to-many relations. For instance, you do not want to store a lot number (text) in the studies table since the lot number is stored in the lot details. You want to store the lot ID in the studies table. Same with the other items from other tables. The details are stored in the detail tables. The details are referenced by the corresponding ID number. On form level you use a 2-column list box to pick an item ID by the displayed text.

See viewtopic.php?f=100&t=40444 for one-to-many relations and many-to-many relations. First you need proper tables and relations. Then you may care about the forms. Base forms do not work on top of bad table design.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Getting filter in the form

Post by Villeroy »

I'm not sure if this actually works because the studies table is still empty. You should be able to fill out the studies table with preset values.
First we choose a condition and write it into row #1 of the filter table. Hit OK.

Then we choose a sub condition based on the condition, a date and a lot ID, write all 3 values into row #0 of the filter table and hit the next OK. All 3 criteria of this filter are optional. Missing criteria are ignored.

This should filter the studies table and any new values entered to the table should inherit the 3 criteria data, sub-condition and lot.
The condition is no longer stored to the studies table since the sub-condition implies its parent condition.
The stored sub-condition is stored by its ID number. See relations window.
The stored lot is stored by its ID number. See relations window.
The filtered studies table form is split into 2 parts. One table control and many single controls. The table control gives the overview, the single controls show the details of the selected record.
The name of the parent condition related to the selected sub-condition is displayed by another subform.
Attachments
Study_Flex_studies_2021-04-09.odb
(59.44 KiB) Downloaded 269 times
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Post Reply