[Tutorial] Forms in OpenOffice.org Base

Forum rules
No question in this forum please
For any question related to a topic, create a new thread in the relevant section.

[Tutorial] Forms in OpenOffice.org Base

Postby RPG » Thu Mar 04, 2010 2:54 pm

Hello

1) Basics about a form
2) Using the tablecontrol / grid control.


Form
I will try to explain the idea of forms in OpenOffice.org. Understanding the idea of forms is realy important when you want work with OOo.
You have also to understand that the word "form" does have two meanings:
    a) the writer document
    b) what you see in the form navigator
When you open a form as document then it is not open in edit mode but only input mode for data. You can open it in edit mode by right clicking and then choose for edit.
When you have open the form in this way you can easy switch between edit mode and not edit mode.

When you have made a form by the wizard then most control are grouped. When you want select a single control then press the control key on your keyboard and select with the mouse a control with left clicking.

For more information see your help file. I think it is important to read your help file there it has a lot of detailed information.

Toolbars
OOo-base does have four toolbars.
    a) Form Navigation Bar
    b) Form Controls
    c) Form Design
    d) More Controls

Most toolbars you can activate with menu --> view --> toolbars.
The toolbar More Controls is (de)-activate with a button in the toolbar where the button for the listbox also is.
When you not have study these controls don't start with base. You can only make or change forms when you can handle this.

Some tools you have to understand and can be activate with button on these toolbars.

Form Navigator
Howto open the form navigator and make it visible
On one of the tool bars there is a buttom with this you can make it visible. In the form navigator you see all elements of your form. The form navigator is an other tool than the navigator

Add Field
Is easy in combination with the form navigator for adding control to your form.

Wizard
You can switch on the wizard for listboxes, comboboxes gridcontrols and some more.


Howto make a new mainform and subforms
The form navigator acts like the explorer in windows. When you want make a new form select the place where you want have it. Right click and select new. You can not choose for a subform or main form. A main form is all what is the first level subforms are below. This means also you can have more then one mainform in your form document.

An important difference between a mainform and a subform is that a subform has always master and slave fields on the property tabpage. With this master and slave fields you can select data in the subform.

Relations and Mainforms to Subforms
For understanding relations study a tutorial about database design. But relations in a database have no meaning for how you organize your form document. Also they are not important for mainform and subform. Important for a mainform- subform is only the master-slave fields.

Editing Controls
All the controls have several properties. These are divide in three different tabpages.
a) General
b) Data
c) Events
Not all control have all tabpages. The data tabpage is only available for controls which can be bound to a record.
When you have made a form by the wizard then most control are grouped. When you want select a single control then press the control key on your keyboard and select with the mouse a control with left clicking.

Button control
On the general tabpage of this control you assign different action to this button. You have to change one value there: Action


listbox and Combobox
When you have litle experience then activate the wizard for making a listbox.

Gridcontrols
A grid is a control who contain other control but it is not a form.
You can add listboxes and comboxes to a grid control but the wizard is not working. The properties from the control inside a table control can differ a little of the same control outside a table control in a form.
I make a listbox somewhere in the form and copy some values to the listbox in the table control, and delete the listbox.
I think the name is table control and for programming we use more gridcontrol. Don't ask why.

more Gridcontrols for tables
When you have more table in your form then you need for each table a main form or sub form. In that form you can use a table. In other words when you have four different table who you want display in gridcontrols then you have also to make four (main/sub) forms.

SQL
In a form you can only use queries who give a result set. You can not insert data in other tables. When you need this queries then you have to use the SQL tool.

Writer
There forms are writer documents you must also understand how writer is working.

Filtering with example
A tutorial made by Arineckaig Here you can find a good explanation about the filters in a form. Also there is an example. I think this must be read when you want make more difficult forms.
http://dl.dropbox.com/u/10552709/FilterExamples.zip

Designing a database
This database tutorial is a detailed introduction how to design a database. You can learn you how to make relation in a database.

Links for SQL
When you want do more with forms and special with SQL read this. It is a little difficult but it can help you to understand what you can do with forms and OOo-base.
http://www.dbbm.fiocruz.br/class/Lectur ... qltut.html
http://www.h2database.com/html/grammar.html
http://wiki.services.openoffice.org/wik ... _Functions

links for OOo
Here you can find tutorials for the complete OOo suite.
http://wiki.services.openoffice.org/wik ... ser_Guides

Link for getting started with Base.
http://wiki.services.openoffice.org/w/i ... thBase.pdf


links for OOo-base and forms
http://wiki.services.openoffice.org/wiki/Database
http://openoffice.org/projects/document ... ctory/Base

When you want use macro then you have to read this. But I strongly advice try to do it without macros.
Links when you want start with macros
Next link is the site of Benitez
http://www.baseprogramming.com/resources.html

Introduction for BASIC and the API
http://wiki.services.openoffice.org/wik ... ASIC_Guide
Last edited by RPG on Fri Oct 19, 2012 1:07 am, edited 9 times in total.
RPG
Volunteer
 
Posts: 1548
Joined: Tue Apr 14, 2009 7:15 pm
Location: Netherlands

Using the table control in a form.

Postby RPG » Thu May 13, 2010 12:11 pm

This part assumes you have read this thread.
I use on this moment the word table control and grid control for the same control. When you start for the first use the wizard for learning about the form also for making a table. You can not do calculation in the TableControl

Only in design mode
When you have made the control with the wizard and want add other control in the TableControl then right click on the header. Changing the properties of the control in the TableControl.

In design mode and working mode
It is possible to hide or make visible columns in the TableControl also the size and the place can be changed.

TableControl.
The TableControl is part of your form and is not a form in his own. So the TableControl points to the same table as the form where the TableControl is in.

Listbox in a TableControl.
Most of the time the listbox use a PK for displaying an other value or selecting a value and storing an other value in the table. This is for starters difficult to understand but when you use the wizard then the wizards guides you. The wizard for a listbox works not in a gridcontrol. But make a listbox in the same form and copy the values in the listbox in the gridcontrol. When you use the standards then it is easy that you changes values by accident.


Showing values with a listbox
A listbox can be used for selecting value which are in an other table. You can use more then one time the same field with an Identifier for displaying an other value. I do think to Name and function of the same person.


Protect to change by accident.
When you want only display the values then it is maybe important to protect against changing by accident. This can be done by changing the properties of the listbox.
change this property : enable set to no.

Macros
In this thread I will only tell the easy things. But for people who want work with macros the next links can be important.
viewtopic.php?f=39&t=24013&p=109535&hilit=grid+control#p109535
http://www.oooforum.org/forum/viewtopic ... vent+table

For those who really like macros they can study this.

Romke
RPG
Volunteer
 
Posts: 1548
Joined: Tue Apr 14, 2009 7:15 pm
Location: Netherlands

Re: [Tutorial] Forms in OpenOffice.org Base

Postby LAURAD » Thu Sep 22, 2011 3:34 pm

Under the "links for SQL":
http://www.dbbm.fiocruz.br/class/Lectur ... qltut.html
This link appears to be dead.
OpenOffice 3.3.0 on Windows 7
LAURAD
 
Posts: 6
Joined: Mon Sep 19, 2011 3:25 pm


Return to Base

Who is online

Users browsing this forum: No registered users and 4 guests