Hello! So, I am supernew to OpenOffice base and I need some help.
I want to make some forms so that the are easy to use by the users, insert a new row in the database, etc.
The one thing I'm having problems with is the queries in a form.
I want the user to be able to select a dropdown from one of the related tables and get back the data just from the selected option in the dropdown and I have no idea how to do that tbh. If you could help me!
Thank you so much, I'll attach the DB (it's just a simple example so that you can help me solve the problem)
[Solved] Help with queries and forms
-
- Volunteer
- Posts: 1549
- Joined: Wed Jun 24, 2015 12:56 am
- Location: Colorado, USA
Re: Help with queries and forms
Look at the Example Form in the attached .odb file
It uses a ListBox to select/display the "currentPlacement"
Open the Form in the Edit/Design Mode
Right click on the column CurrentPlacement and select Column to open the Listbox Properties dialog.
On the Data tab the List content contains the query.
ListBox queries take the general format of
The ORDER BY clause is optional and probably not needed since you only have 5 choices.
"Bound Field" is the integer value corresponding to the "Display Field" in "Some Table"
It uses a ListBox to select/display the "currentPlacement"
Open the Form in the Edit/Design Mode
Right click on the column CurrentPlacement and select Column to open the Listbox Properties dialog.
On the Data tab the List content contains the query.
Code: Select all
SELECT "currentPlacement", "idPlacement" FROM "Placement_TABLE" ORDER BY "currentPlacement" ASC
Code: Select all
Select "Display Field", "Bound Field" From "Some Table"
"Bound Field" is the integer value corresponding to the "Display Field" in "Some Table"
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
Apache OpenOffice 4.1.14 & LibreOffice 7.6.2.1 (x86_64) - Windows 10 Professional- Windows 11
Re: Help with queries and forms
Hello! But now I can see where I can just show in the List the data that is currently in the DB table, but I can't see how to still do what I want to do.
What I meant is that when the user opens the form, it will have that List Content where every single currentPlacement is displayed and when you select one it shows me a table with the results for that one, for example Winger
Thank you so much
What I meant is that when the user opens the form, it will have that List Content where every single currentPlacement is displayed and when you select one it shows me a table with the results for that one, for example Winger
Thank you so much
OpenOffice 4.1.12 on Windows 10 / MacOs 12.4
-
- Volunteer
- Posts: 1549
- Joined: Wed Jun 24, 2015 12:56 am
- Location: Colorado, USA
Re: Help with queries and forms
That can be accomplished with a simple Form and SubForm.What I meant is that when the user opens the form, it will have that List Content where every single currentPlacement is displayed and when you select one it shows me a table with the results for that one, for example Winger
Here is a link to a Base User Manual https://documentation.libreoffice.org/a ... eGuide.pdf
In your main database window select Forms >Use Wizard to Create Form
From the 1st page of the Form Wizard select Table: Placement_TABLE
Add both of the Available fields to Fields in the form
Next to get to page 2 of the wizard.
Check Add Subform then Subform based on existing relation and select players
Next to get page 3 of the wizard and add all the Available Fields to Fields in Form.
Next should take you to page 5 of the wizard.
For this use Table controls (the wizard will display as Data Sheet) for both main form and subform
Next to get page 6 of the wizard
Next to accept the defaults on page 6 and move to page 7 of the wizard
You can use the default or pick a different color combination for your new form.
Next to page 8 of the wizard
You can use the default or type in a new Name of the form
Check Work with the form
select Finish
the new form will open.
select a placement in the upper table and the lower table will display all players with that placement.
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
Apache OpenOffice 4.1.14 & LibreOffice 7.6.2.1 (x86_64) - Windows 10 Professional- Windows 11
Re: Help with queries and forms
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
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice