[Solved] "Query Design" results NOT= query in form

Creating tables and queries
Post Reply
1gatomontes
Posts: 20
Joined: Sun May 14, 2017 3:48 am

[Solved] "Query Design" results NOT= query in form

Post by 1gatomontes »

When I run my query in the "Query Design" tool, I get the expected results.
When I use this same query in a form, I get a different result.

Database of volunteers.
Query is searching for volunteers who have taken training courses.
Tables involved: volunteer table, course table, join table.

When used in the form, only the first course will be listed.

Query:
SELECT "table_benevoles"."attr_benevole_id", "table_benevoles"."attr_benevole_prenom", "table_benevoles"."attr_benevole_nom", "table_formation"."attr_formation_nom"
FROM "table_benevoles", "table_benevole_formation_v2", "table_formation"
WHERE "table_benevoles"."attr_benevole_id" = "table_benevole_formation_v2"."attr_benevole_id"
AND "table_formation"."attr_formation_id" = "table_benevole_formation_v2"."attr_formation_id"

In the form, I'm using a text box to display the list of courses taken by the volunteer, and I have the feeling that my problem might lie there (text box properties), as opposed to within the query itself, but I can't see it.

Thank you
Last edited by RoryOF on Wed Jun 28, 2017 7:13 am, edited 2 times in total.
Reason: Added green tick. [RoryOF, Moderator]
OpenOffice 4.1.2
Windows 10 (v.1607)
User avatar
charlie.it
Volunteer
Posts: 417
Joined: Wed Aug 21, 2013 2:12 pm
Location: Italy

Re: "Query Design" results NOT= query in form

Post by charlie.it »

1gatomontes wrote:In the form, I'm using a text box to display the list of courses taken by the volunteer
Ciao, you must use a text box for each of fields. Is it your issue?
charlie
Italian AOO Admin
macOS 14 Sonoma M1: Open Office 4.1.15 - LibreOffice 7.5.7.1

http://www.charlieopenoffice.altervista.org
1gatomontes
Posts: 20
Joined: Sun May 14, 2017 3:48 am

Re: "Query Design" results NOT= query in form

Post by 1gatomontes »

I don't think so. The only field I want to display in the text box is the name of the course. That works well as long as a volunteer only has one entry in the training table. But I still only get one record even if a volunteer has taken 2 or morte courses.

Attached is an example where my volunteer has more than one course listed in the training table, but only the first instance shows up.

Am I missing your point?
Thanks Charlie.it!
Attachments
multi_courses_not_displaying.jpg
OpenOffice 4.1.2
Windows 10 (v.1607)
UnklDonald418
Volunteer
Posts: 1547
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA

Re: "Query Design" results NOT= query in form

Post by UnklDonald418 »

In the form, I'm using a text box to display the list of courses taken by the volunteer, and I have the feeling that my problem might lie there
Yes, a Text Box can only display one line.
You need a Table control to display multiple lines/matches.
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
UnklDonald418
Volunteer
Posts: 1547
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA

Re: "Query Design" results NOT= query in form

Post by UnklDonald418 »

Maybe a little more detail will help.
I'm assuming you are using the Query to supply data to a SubForm.
Add a Table control to the SubForm.
Right click on to top line of the Table control and select Insert Column -> Text Box
Right click on the new Column header and select Column to open the Properties: Text Box dialog.
On the Data tab select the field you want to display, and on the General tab you can change the name of the Column and make any formatting changes you want.
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
1gatomontes
Posts: 20
Joined: Sun May 14, 2017 3:48 am

Re: [Solved] "Query Design" results NOT= query in form

Post by 1gatomontes »

Yes Uncle Donald, indeed, a little more details did help a lot :)
Much appreciated!
OpenOffice 4.1.2
Windows 10 (v.1607)
Post Reply