LibreOffice-Suite-Base/C3/Create-Subforms/English

From Script | Spoken-Tutorial
Revision as of 20:27, 27 November 2012 by Chandrika (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Visual Cue Narration
Show Slide Number 1

Spoken tutorial on LibreOffice Base: Subforms

Learning Objectives

Create a Subform

Welcome to the Spoken tutorial on LibreOffice Base.

In this tutorial, we will learn how to

Create a Subform

Show Slide Number 2

Create a form with a subform

Example: List all the members of the library and build another list of those books that are not yet returned by each member.

Use this form to update when a member returns a book.

For this, let us continue with our familiar Library database example.

And we will consider the following case:

How can we list all the members of the library?

And for each member, how can we see only those books that have not yet been returned by that member?

One way is to create a form listing all the members in the library

And then creating a subform below it, to list those books that have not yet been returned by the member.

Once we design this form, we will be able to update the form.

For example, when a member returns a book, we can update this information.

Show Slide Number 3

Show screenshot of FormwithSubformScript14.JPG and show cursor movement as narration goes forward.

And, here is a sample screenshot of the form we will design.

Notice it also shows a subform at the bottom.

Go to the main Base window.

Click on Queries on the left panel, Point at ‘History of Books Issued to Members’ query.

Right click on ‘History of Books Issued to Members’ query and click on copy and then right click and then paste

Type ‘Books Not Returned’ and click on ok.

Lets open our Library database.

In our previous tutorials, we created the ‘History of Books Issued to Members’ query.

Now we will use this query and the members table as the base for creating our new form.

Let us first copy this query, by right clicking on the query name, and then let us click on paste.

In the popup window for query name, let us type in a new name: ‘Books Not Returned’

Right click on ‘Books Not Returned’ and click on edit. Let us now open the ‘Books Not Returned’ query in edit mode.
Type in =0 in the Criterion column under the CheckedIn

Press enter.

Click on Save icon on top, and close window.

In the Query Design window, let us add a criterion to show only those books that are not checked in.

For this, let us type ‘equals 0’ in the Criterion column under CheckedIn

And press Enter.

Let us now save the query and close the window.

Click on the Forms icon on the left panel

Click on the ‘Use Wizard to create Form’

In the main Base window, let us click on the Forms icon on the left panel

And then click on the ‘Use Wizard to create Form’ option.

Click on the ‘Table: Members’

Click on >> button

Click on the next button.

Now we see the familiar Form wizard.

Let us go through the 8 steps on the left to create our form.

In step 1, field selection, let us choose ‘Table: Members’

Then let us move all the fields to the right side.

And let us click on the Next button.

Check the ‘Add subform’ checkbox,

Click on the option that says: ‘Subform based on manual selection of fields’.

Click on the next button.

We are in Step 2. Setup a subform.

So here, let us check the ‘Add subform’ checkbox,

And click on the option: ‘Subform based on manual selection of fields’.

Click on ‘Query: Books Not Returned’ from the Tables or Queries dropdown.

Double click on the following: Book title MemberId, Issue Date Return Date Actual Return Date checkedIn

Click on the next button.

Let us go to Step 3. Add subform fields.

Here we will call our new query which we designed a few minutes ago.

So let us choose ‘Query: Books Not Returned’ from the Tables or Queries dropdown.

And we will move selected fields from the available list to the right side as shown on the screen. <pause>

Click on Next.

Click on MemberId field from the top two drop downs.

Click on the Next button.

Step 4. Get joined fields.

Here we will choose the MemberId field from the top two drop downs, as this is the only relating field.

And click on the Next button.

Click on the third option, Data sheet for both the form and the subform.

Click on the next button.

Step 5. Arrange Controls

Here we will choose the third option, Data sheet for both the form and the subform.

And click on the Next button.

Click on the next button. Step 6. Set data entry.

Here, we will leave the options as they are and click on Next.

Click on Grey.

Click on the next button.

Step 7. Apply Styles.

Let us choose Grey as the form background.

And go to the final step.

Type ‘Members Who Need to Return Books’ for form name.

Click on the Modify form option

Click on the Finish button.

Step 8. Set Name.

Here let us give a descriptive name to our form: ‘Members Who Need to Return Books’

And let us click on the Modify form option, as we are going to do some more changes.

Now lets click on the Finish button.

Click on the label icon in the Form Controls toolbar t the top, draw one above form Use reference image FormwithSubformScript14.JPG.

Double click on the top label to open properties. Here type in ‘Members of the Library’ against label. And for font, click on the adjacent button and click on Arial, Bold and Size 12.

Draw a second label above the subform. In the properties, type ‘List of Books to be returned by the member’ against the label. And Font to Arial, Bold and Size 12.

In the form design window, notice that there are two tabular data sheet areas.

The one above is called the form and the one below is called the subform.

Now, let us add a label above the form.

We will click on the Label icon in the Form Controls toolbar at the top, and draw it on the form.

Double clicking on the label, brings up its properties.

Here we will type ‘Members of the Library’ against label

And change the font style to Arial, Bold and Size 12.<pause>

Similarly, let us add a second label above the subform as shown on the screen

And call it ‘List of Books to be returned by the member’ <pause>

Click on the form.

Then click and drag the right side green box to shorten the form length. Then click in between Name and Phone field and drag it to right.

Click on the subform. Then click in between Book title and Issue Date and drag it to right.

Then double click to open properties. Here, change Font to Arial, Bold and Size 8 and Background color to Blue 8.

Next let us shorten the form’s length as shown on the screen

And then let us increase the length of the Name field in the form. <pause>

Similarly, let us lengthen the book title field in the subform. <pause>

Let us change the fonts here to Arial, Bold and Size 8.

And the background color to white for the form and Blue 8 for the subform. <pause>

Click on form. And in the properties, choose white for the background color

Right click on MemberId column in the subform, and click on Hide column.

Click on Save icon. Close the window.

Next, let us hide the MemberId column by right clicking on it and choosing the Hide column option.

Okay, we are done. So let us save the form designand test it.

From base main window, double click on the ‘Members Who Need to Return Books’ form

Show cursor movement as narration goes forward.

Type in 12/7/11 in ActualReturnDate field and check the CheckedIn for any record in the subform. Press enter.

Click on Refresh icon in the Form Navigation toolbar at the bottom.

Show cursor movement over the subform.

In the main Base window, let us open the ‘Members Who Need to Return Books’ form by double clicking on it.

There is the form.

Let us browse through the members, by either using the up or down arrow keys,

Or by simply clicking on the various member names.

Notice that the subform below refreshes and shows books to be returned.

In the subform, let us choose any record

and let us type in ‘12/7/11’ in the actual return date field and check the CheckedIn field


and press Enter.

Let us now refresh the form by clicking on the Refresh icon in the Form Navigation toolbar at the bottom.

Notice that the record we just edited is no longer listed here,

which means that the book has been returned or checked in.

So there is our form with a subform.

Show Slide Number 3

Summary

Create a Subform

This brings us to the end of this tutorial on Subforms in LibreOffice Base

To summarize, we learned how to:

Create a Subform

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, signing off. Thanks for joining.

Contributors and Content Editors

Chandrika