Once you have a database set up, sooner or later you will want to edit its tables or add a new record. You have four ways to do so.
If you created a database using an existing OpenOffice.org Calc or MSExcel spreadsheet, you must edit the spreadsheet itself--in Base, thedatabase will open read-only, and you will be unable to edit it.
For other databases, you have three choices: editing the tablesdirectly, using the form wizard to create a form or using the designview to create a form. Whichever way you create a form, you can thenuse it as a more user-friendly way to edit your database.
Editing a Table Directly
Editing a table directly is the purist's way of adjusting adatabase. It is not hard to do, but some users find it intimidating andmay prefer one of the other methods.
To edit a table in a database directly, open the database and changethe view in the Database pane on the left side of the window to Tables.Then, select the Table in the Tables pane, and right-click for thecontext menu.
If you want to add a field to the database, select Edit to open aview of the table. Click the first vacant role to start adding a newfield. As with other fields, you need to enter a name in the firstcolumn and a field type in the second column. You also can enter thefield properties in the window of the pane that opens below the mainediting window, setting whether the field is required, the number ofcharacters it can contain and, optionally, a default value and example.In addition, back in the main window, you have the option of adding abrief description of the new field in the unnamed third column.
When you are done, right-click on the gray left-hand column toselect the new field, and use the context menu to cut and paste it intothe position you want. You also can alter, delete or move existingrecords using the same technique.
If you want to add a record to the database, select Open from thecontext menu in the Tables pane, or double-click the table to open theediting window. With this selection, you see the fields listed at thetop of columns and the individual records in rows. Otherwise, just aswhen you edit fields, you add new entries at the bottom. Becauserecords are far more flexible than fields, you can change how recordsare viewed by using the icons on the right of the toolbar to sort allrecords in the table, in ascending or descending order, or to displayonly those you set in a filter.
Designing a Form Using the Form Wizard
If tables seem a forbiddingly cold way of working with a database--agood example of why you've shied from databases in the first place--youmay prefer to design a form for editing records. The easiest way todesign a form is using the Form Wizard.
To use the Form Wizard, select Forms from the Database pane,followed by Use Wizard to Create Form in the Tasks pane in the topmiddle of the window. This selection opens both the Form Wizard and theDesign View, where you can see the form taking shape as you progressthrough the wizard.
On the first page of the wizard, you select the table for the formfrom the drop-down list, and the fields to include in the form byselecting them and moving them from the Available fields pane to theFields in the form pane using the arrow controls in between the twopanes.
You can skip the next three pages of the wizard, where subforms arecreated (they're a topic for another day). On the fifth page, youselect how entry fields will be arranged on the form and whether theywill be left- or right-aligned. Which arrangement you choose is mostlya matter of whether you want the labels of the field to the left of theentry fields or above them, and whether each entry field is the samelength or reflects the number of characters it may have. A third optiongives you a view much like the one you have when you edit a tabledirectly, but apart from the fact that you can select colors and maybeadd a background picture, this option probably won't appeal to anyonewho wants to use the wizard.
Clicking the Next button, you receive a list of choices of what datayou want to appear on the form. Most of the time, you probably want thedefault of displaying all the available data, but you can choose not toshow existing data and whether modification of existing data, deletionsor addition of new data are possible on the form.
On the next pane, you can select a pre-existing color scheme. To behonest, most of the schemes are uninspiring, but you always can alterthem later in the design view if none appeal to you.
Finally, set the name of the form and save your work.
Creating a Form in Design View
The Design View is a more hands-on method of creating an editingform. Chances are that you won't want to design a form from scratch inthe Design View, but you might want to use it to edit a form aftercreating it in the wizard. For example, you might want to add a titleto it, change the background color or add a picture as eye-candy tohelp calm those with a database allergy.
To open Design View, select Forms from the Database pane, followedby Create Form in Design View in the Tasks pane in the top middle ofthe window. You open in Design View, which is identical toOpenOffice.org Writer, except that it has the Form Controls toolbardown the left side of the window. If you look closely, you can see thatthe grid is turned on to help you arrange entry fields as neatly aspossible.
To add an entry field, select the field type from the Form Controlstoolbar. Then, in the window, drag with the mouse to define the sizeand shape of the entry field. You probably will have a hard timeindicating exact field lengths (unless you want to count grid points),but otherwise, you should have little trouble if you keep an eye on thegrid. If you want to reposition or resize the result, click theresulting entry field and move it about just as you would any otherobject in OpenOffice.org.
Double-click the entry field, and the Property box appears. Here,you set the characteristics of the entry field, using the same valuesthat the fields in the database have. To keep the form and the databasein sync, go to the Tables view and select Edit from the context menu soyou know the names of the fields and their types and properties. If youare working on a small screen, you might want to jot the informationdown on paper, rather than juggle the two different views.
Once the field's properties are set up, add a text label from theForm Controls toolbar. You probably will want to give it the name ofthe field associated with it, but you might consider another name,especially if the form will be used by people who might not becomfortable with the straight field names.
Do the same for all the other entry fields, and position them as youwant. Annoyingly, you cannot group label fields and entry fieldstogether so you can reposition them as a single object, but the gridshould partly compensate for that shortcoming.
As a final touch, you can enter other text, such as instructions ortitle, or go to Format -> Page to edit the background for the form.
Using a Form
No matter how a form is created, using it is the same. Select Formsfrom the Database pane, and click the name of the form in the Formspane in the bottom middle of the editing window to open the form. Theform opens in a modified version of the Design View, with some othercontrols grayed out and the Forms Control toolbar at the bottom of thewindow.
The Forms Control toolbar has icons for sorting records in ascendingor descending order and for setting up filters--either of which can helpyou find an existing record more quickly. It also has arrow buttons tomove through the records and a field to allow you to jump to the recordyou wish to edit.
To delete the current record, click the Delete button in the FormsControl toolbar. To add a record, either select the fifth arrow buttonfrom the left or, at the last record, the next arrow button. Eitherway, all entry fields in the form become blank so that you can enterthe new record.
Conclusion
None of these three editing methods is absolutely superior to theothers. Which you use depends on your preferences and, perhaps, yourcircumstances--for instance, if you have reduced vision, a form might bemore practical, because you can select fonts for the labels and entryfields that you can easily see. Others might prefer using the wizardfor the sake of speed, or using the Design View for the completecontrol it offers in form creation.
But, no matter which you use, once you are comfortable with yourchoice, you will have come a long way in taming your initial misgivingsof databases. Who knows? You might even begin to believe that databasesare a useful way of storing information.