[Solved] Adding Fields

Discuss the database features
Post Reply
Fao
Posts: 19
Joined: Thu Jan 18, 2018 4:31 pm

[Solved] Adding Fields

Post by Fao »

I created a database, I need to add fields to it, can anyone explain this process in plain English?
Last edited by Fao on Tue Jan 23, 2018 10:13 pm, edited 1 time in total.
OpenOffice 4.1.2 on Windows 7
UnklDonald418
Volunteer
Posts: 1547
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA

Re: Adding Fields

Post by UnklDonald418 »

Have you read the documentation for Base?
https://wiki.openoffice.org/wiki/Docume ... e_Chapters
Look for Chapter 8 – Getting Started with Base
If you are using the default Embedded database model (look in the lower left corner of the Base main page) then you can use Create Table in Design View to open the table design GUI. If you already have a table right click on the table name and select Edit to open the table design GUI.
In the first blank row type a name in the Field Name column. It can be anything meaningful to you (i.e. FirstName)
In the second column (Field Type) select what type of data you want to store in that field. There are over 20 choices but the most commonly used ones are TEXT(Varchar), INTEGER, DECIMAL, DATE.
The third column (Description) is entirely optional. You can type in any notes that might help you, but it isn't used any place else.
When you have finished entering all the fields you want press <Ctrl>S or click the Save icon. If you are creating a new table you should get a dialog allowing you to enter a name for the new table.
Also if you are creating a new table,it should next ask Should a primary key be created? Answer Yes
The table will be created with a new ID field in the first position.
Select that ID field. Notice that it has a small yellow key icon in front of the field name, indicating that it is a Primary Key. (Right click on a field name to toggle the Primary Key selection)
Look towards the bottom of the dialog and change Auto Value to Yes.
Save the changes and close the dialog.
The table is now ready to use.
Double click on the new table and you can enter data directly into the table, or better yet design a Form to allow a more user friendly environment.
If your problem has been solved, please edit this topic's initial post and add "[Solved]" to the beginning of the subject line
Apache OpenOffice 4.1.14 & LibreOffice 7.6.2.1 (x86_64) - Windows 10 Professional- Windows 11
Fao
Posts: 19
Joined: Thu Jan 18, 2018 4:31 pm

Re: Adding Fields

Post by Fao »

I used table view to create a new db (I think you have to go that way), I have a table and a form, it is easy to add fields to the table (right click on the table from the main screen/select edit). Those new fields do no appear in the form, on in the table view. How do I get that screen where you select all fields from the table (including any that I added since creating the db) and right arrow to add them to the right pane (thereby adding them to the form)?
OpenOffice 4.1.2 on Windows 7
UnklDonald418
Volunteer
Posts: 1547
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA

Re: Adding Fields

Post by UnklDonald418 »

You can of course use the Wizard to create a new form but to edit and existing form you must add fields one by one. The process is explained in Chapter 8 – Getting Started with Base
Open the form in the Edit/Design mode.
If the Form Controls aren't visible along the left margin enable them by going to View->Toolbars and selecting Form Controls. There are a number control types including Text Box and Formatted Field. Further down the list is an icon for More Controls. Click on that to display a floating toolbar with additional controls.
You must select a control type for your new field. For instance if your new field contains text select Text Box.
The mouse pointer changes to cross-hairs. Use click and drag on an empty area of your form to add a new control box to your form.
Right click on the new control box and select Control to open the Properties:Text box dialog.
On the Data tab click on the down arrow to the right of the Data field property. The list should display all the fields available. If the data for the form you opened is supplied by the table you edited, your newly added field should appear on the list.
Select the field
Click on Design Mode On/Off to enter the live mode to verify that the data in your new field is displayed.

To add a column to a table control right click on the column names area along the top of the table and select Insert Column to see a list of all the column types. Select the appropriate type for the data you want to display.
Right click on the newly added column and select Column to open the Properties dialog. On the Data tab select a field from the Data field list.
If your problem has been solved, please edit this topic's initial post and add "[Solved]" to the beginning of the subject line
Apache OpenOffice 4.1.14 & LibreOffice 7.6.2.1 (x86_64) - Windows 10 Professional- Windows 11
Fao
Posts: 19
Joined: Thu Jan 18, 2018 4:31 pm

Re: Adding Fields

Post by Fao »

Thanks for that information, I'm going to try to find this guide that get referred to and read up a bit, but I was unable to add a field that way. When I am in design view and select "More Controls" the floating tool bar has ten boxes between the two controls with arrows at the top and the one at the bottom, none of those ten are called "Text Box". I did find a way to add fields, though, along the bottom edge there is a control box called "Add Field" (maybe a difference between versions 4.1.2 and 4.1.5?) - seemed logical so I tried using that. This brings up a list fields for the db, the one I am trying to add "(Status") is on the list so I double clicked on it and it showed up on the main screen in design view; after playing around with resizing, moving, sliding left and right (to make the whole box filled in with a white background like the rest of the fields), moving the label from inside the box to above it...I got it to the point that it looks more or less the way I want it to, except for the look of the label (it is black and bolded, while the rest are white). I am trying to figure out how to change the font-related properties of that one labbel, I tried holding down Ctrl then selecting the label (so it is selected separately from its corresponding box), R click/control, which brings up a properties box with three tabs, none of which contain font colour or a bold control. On the far right, outside of that control box, there is another properties box (for the whole form, I guess) but when I click on the "Style and Formatting" control there, buttons at the top of that screen are greyed out when I have a field selected to work on (has the six green boxes around it). There must be a way to change the colour of the label text/unbold it.
OpenOffice 4.1.2 on Windows 7
UnklDonald418
Volunteer
Posts: 1547
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA

Re: Adding Fields

Post by UnklDonald418 »

The Text Box icon in on the left margin it has a small box containing ABC.
You were close
I tried holding down Ctrl then selecting the label (so it is selected separately from its corresponding box), R click/control, which brings up a properties box with three tabs, none of which contain font colour or a bold control.
Actually, if you have selected the label field only you should get the Properties: Label Field dialog which has only 2 tabs.
On the General tab look on the list for Font. At the very right of that row click on a box with an ellipsis (…) to open the Character dialog.
On the Font tab are the font, typeface and size options.
On the Font Effects tab are a number of other properties including color.
If your problem has been solved, please edit this topic's initial post and add "[Solved]" to the beginning of the subject line
Apache OpenOffice 4.1.14 & LibreOffice 7.6.2.1 (x86_64) - Windows 10 Professional- Windows 11
Post Reply