Getting filter in the form

Creating and using forms

Getting filter in the form

Postby syp1977 » Fri Apr 09, 2021 8:24 am

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 24 times
OpenOffice 4.1.2 on Windows 10
syp1977
 
Posts: 1
Joined: Thu Apr 08, 2021 7:58 pm

Re: Getting filter in the form

Postby Villeroy » Fri Apr 09, 2021 11:07 am

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: 29581
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Getting filter in the form

Postby Villeroy » Fri Apr 09, 2021 5:18 pm

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 19 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
User avatar
Villeroy
Volunteer
 
Posts: 29581
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany


Return to Forms

Who is online

Users browsing this forum: No registered users and 4 guests