LibreOffice-Suite-Base/C2/Add-List-Box-form-control-to-a-form/English

From Script | Spoken-Tutorial
Jump to: navigation, search
Visual Cue Narration
Show Slide Number 1

Spoken tutorial on LibreOffice Base: List Box Control

Learning Objectives

Add a List Box form control to a form

Welcome to the Spoken tutorial on LibreOffice Base.

In this tutorial, we will learn how to

Add a List Box form control to a form

Show Slide Number 2

Show Image BookIssueFormDesignScript5.JPG.

In the last tutorial, we learnt how to modify a form using LibreOffice Base.

We also saw this image of the form that we started creating and modifying in the last tutorial. <pause>

Show Slide Number 3

Show Image BookIssueForm1stViewScript6.JPG

Move mouse pointer over fields and buttons as narration goes forward.

And once we are done with our design, this is how our form will look like. <pause>

Notice here, that we are seeing the first record in the BooksIssued Table.

And, we are also seeing list boxes with real book titles and member names, instead of bookIds and memberIds.

Here are some push buttons at the bottom for performing actions like saving a record, undoing the changes etc.

So in this tutorial, we will learn how to add a List box form control to our form.

Open LibreOffice Base program from Windows Start-->All Programs-->LibreOffice Suite--> LibreOffice Base

Click on the 'open an existing database file' option. In the 'Recently Used' drop down box, Library should be visible, now click on the Finish button.

Let us first invoke the LibreOffice Base program, if it is not already open<pause>

And open our Library database.

If Base is already open, then we can open the Library database from here by clicking Open under the File menu

or by clicking the Recent Documents under the File menu

In the Base main window, right click on the form 'Books Issued to Members', and click edit. Now we are in the Library database.

Let us open 'Books Issued to Members' form that we created in the last tutorial.

To do this, let us click on the Forms icon on the left panel

And right click on the 'Books Issued to Members' form on the right panel, and then click on edit.

Click on the text box right of 'Book Title', right click and click on cut.

Click the view menu on the top, then click on toolbars and then point on Form Controls.

In Form controls toolbar, point mouse slowly over the icons one by one from the left.

We are now in the form design window.

Let us first consider the 'Book Title' label.

Notice that the text box here will only display BookId numbers which are not friendly on our eyes. For us, book titles are friendlier.

And so, to display these titles, Base provides some ways, and one of the ways is by using a List box form control.

Let us see how.

For this, let us first remove the text box adjacent to the Book Title label.

We can do this by clicking on the text box which selects it with the familiar set of green boxes,

And then by right clicking and clicking on 'Cut' at the bottom.

There, we have removed the text box.

Now, we will place a List box form control here.

This can be accessed in the Form Controls toolbar.

We can bring it up by using the View menu and clicking on the Form Controls.

Notice that Base provides us a lot of form controls; let us point our cursor over these icons to read the tool tips. <pause>

Click once on List box icon(9th). Show the tooltip that will say List box that appears as the mouse points to it. Let us find our list box icon.

There it is, let us click just once on this icon.

Click, drag and drop it on the form where the text box was removed. And let us move the mouse pointer into the form; notice that it has changed to a thin plus symbol.

Now we can draw the list box form control on our form;

For this, we will simply click, drag and drop it on our form

Let us place it where we removed the text box earlier.

Notice that a new wizard called 'List Box Wizard' has opened up over the Form design window.

Now, this wizard will help us connect the list box to the Book title label.

Let us see how.

Click on the Books table in the list.

Click on Next button.

In this wizard, let us first, choose the table from where we can get the book titles.

We will choose the Books table from the list and click on the Next button.

Click on title in the list.

Click on the next button

Now, in this window, we need to choose the field that will be displayed in the List box.

And we know that the title field stores the book titles.

So let us go to the next step.

Point cursor over left list

Point cursor over right list

Point cursor over BookId

Click on bookid on the left side list that says 'Field from the value table' and click on bookid on the right side list that says 'Field from the list table'. Click on the Finish button

This final window is where we will do the magic.

We will connect the related tables and fields.

Look at the field names. The 'Fields in the Value table' on the left are the fields in the BooksIssued table

And the 'Fields in the list table' on the right are the fields in the Books table.

We also know that bookid is the key field in the books table and is represented in the BooksIssued table.

So we will click on bookid on the left side list that says 'Field from the value table'.

Next we will click on bookid on the right side list that says 'Field from the list table'.

Click on the Finish button to close this wizard.

There, we have connected the related tables and fields.

Now Base will automatically display all the Book titles in this List box.

Click on save icon below file menu.

Close the window.

Let us now save the form.

And close this window.

Show Slide Number 4

Show Image BookIssueForm1stViewScript6.JPG

In the next part of the Base tutorial, we will continue adding the rest of the form controls to our form.

And this is how our form will look like, when we are done.

Show Slide Number 5

Assignment: Add a second list box for Member Names

Here is an assignment.

Add a second list box for listing member names instead of the unfriendly member Ids.

Do not worry about the placement of the list box now. Just draw it to the left of the Member name label.

We will relocate it appropriately across the Member Name label in our next tutorial.

Show Slide Number 6

Add a List Box form control to a form

This brings us to the end of this tutorial on List Box Control in LibreOffice Base

To summarize, we learned how to:

Add a List Box form control to a form.

Acknowledgement Slide Spoken Tutorial Project is a part of the Talk to a Teacher project, supported by the National Mission on Education through ICT, MHRD, Government of India. This project is co-ordinated by http://spoken-tutorial.org. More information on the same is available at the following link http://spoken-tutorial.org/NMEICT-Intro. This script has been contributed by Priya Suresh, DesiCrew Solutions Pvt Ltd. Thanks for joining.
In the Base main window, right click on the form 'Books Issued to Members', and click edit.

In the Form design window, in Form controls, toolbar, click once on List box icon(9th). Do Click, drag and drop on the form left of the member name label for now. Don’t worry about placement or aligning now.

In the List box wizard, Click on the Members. Click Next button Click on the 'name'. Click Next button. Click on MemberId on the left side. Click on memberId on the right side. Click on Finish. Press Control S.

We have just created the Member name list box.

Contributors and Content Editors

Chandrika