Linking the main fields of the sub form correctly

Creating and using forms
Post Reply
SuchALlama
Posts: 4
Joined: Thu Oct 12, 2017 2:37 pm

Linking the main fields of the sub form correctly

Post by SuchALlama »

Hi,

I have made a form to view data form database, which have one sub form. I also have added list box and button with action "Refresh form". So the form should operate like this: when I choose a value from listbox and refresh the form, it only shows the records in the subform which have the chosen attribute.

Currently the sub form shows the table that is linked to it just fine, but when I link the same attributes from two different tables (i.e main fields that has different tables but same attribute), the sub form now only shows the value that is in the list box and other columns are just blank. There is also one row.

So what I want is that sub form shows all the values that has the same value as the list box selection in the sub form.
OpenOffice 4.1.3 on Win7
UnklDonald418
Volunteer
Posts: 1548
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA

Re: Linking the main fields of the sub form correctly

Post by UnklDonald418 »

Your question is a little vague, but it sounds like you need a SubSubForm linked to the SubForm using the value selected in the listbox. If the SubSubForm needs to display data from more than one table use a query as a data source.
For more specific help upload a sample.
If your problem has been solved, please edit this topic's initial post and add "[Solved]" to the beginning of the subject line
Apache OpenOffice 4.1.14 & LibreOffice 7.6.2.1 (x86_64) - Windows 10 Professional- Windows 11
SuchALlama
Posts: 4
Joined: Thu Oct 12, 2017 2:37 pm

Re: Linking the main fields of the sub form correctly

Post by SuchALlama »

Well, I made an example db with 1 form which have 1 sub form and 3 tables: "cars", "colors" and "filter". I know that my relations might be little bit off, but now the form clearly shows that when we select color from list box (i.e. filter by color) and hit refresh, it only updates the color value (which is shown as integer) and other values are shown blank in the sub form.

The query might be an answer to this, but maybe this example will tell more about the problem?

EDIT: Ok, now when I downloaded it from here and tested it, it seems to work just fine (at least what I hoped for)?
Attachments
db_example_20_10_17.odb
(13.08 KiB) Downloaded 183 times
OpenOffice 4.1.3 on Win7
Post Reply