relational database, quick quide using openoffice org base, part 1
Create tables using wizard:
from sample table "Customers", add fields:
-"set primary key": "use an existing field as primary key"/"Fieldname"="CustomerID"
-from sample table "Tasks", add fields:
and from sample table "Customers", add field:
-"set primary key": "use an existing field as primary key"/"Fieldname"="TaskID"
tools/relationship: Customers.CustomerID -> Tasks.CustomerID
Forms/use wizard to create form
From Tasks table add all items
Edit forms to show custom fields:
Right click on "Tasks" form, click edit
Right click on CustomerID
Right click on CustomerID/column
"Type of list contents"=Sql
"List content", click on "...", add Customers table
(here we set display to show company name first instead of just company id.)
column next to it
Make sure CompanyName is first, then CustomerID.
Save form. close.
(optional: if you want to display one record per page,
on "5. Arrange controls" part of form wizard, select one of the "columnar" form layout.
also, later when editing:
right click on group (text + text field), group/ungroup
right click on text field, control/properties, general/dropdown=yes.)
And finally, using form:
Add at least two rows in "customers" table using "tables" tool.
(just click on tables in left panel, then on customers in right panel)
You can add more data using "Tasks" form.
You can create another form for adding more customers.
Optional: Reports and query:
-Query, use wizard:
add from tasks table: Description
add from Customers table: CompanyName
(you can choose whichever you want.)
Edit query: Customers.CustomerID -> Tasks.CustomerID
so you do not have double display
use query as source.
what is relational database?