Starting with Form in OpenOffice Base

As with setting up the tables, you can choose to use a wizard to create a basic form or from scratch. To create a new form from scratch, select Create Form in Design View. This should bring up a window with a blank document. There should be a toolbar on the left, containing the controls that can placed on the form. Should the toolbar be missing, you can turn it on by selecting View -> Toolbars -> Form Controls. Controls are placed by selecting the type of control and selecting the area where you want to place it.

With most fields that you place on the form, you would intend for it to record or show information from a particular field (or column) in a table. Base can take of this for you, but you would have to tell it where the information comes from. To set this information, right click on the control or field that you have placed on the form and select Form. In the Data tab, with Content Type set to table, and the content field set to the table containing the field. With that set, close the dialog and right click on the control or field and select Control.

A form that is bound to the Members table.

In the Data tab, go to the Data field field and select the field from the list.

A field that is configured the "First name" field of a table.

The List control field provides a drop down box that the user must select a value from. This value may be a value from another table and could be used for fields or columns that is a foreign key from another from a preset list of values. These values may come from another table or an SQL query. When you place a list control field on the form, a dialog is popped up that allows you to configure it. You can also configure by visiting the same Data tab. Type of list contents determines what type of source contains the values and List content will determine where the values are actually from.

In this example, the list field is being configured to show a list of universities.

A Combo Box works like an autocomplete field. Similar to a List control field, it can be bound to a list of values and is configured in the same way.

The Pattern control field will ensure that the contents of the field is in a specific format. For example, a Pattern field could be set up to display a date in the DD-MM-YYYY form. After placing the field on the form, right click on the control field and select Control and open the General tab. In the Character mask, enter NNLNNLNNNN and for Edit mask, enter __-__-____ (i.e. two underscore characters, a dash, two underscore characters, another dash, followed by four more underscore characters).

Configuration for a pattern field to hold a date.

The N in the Character mask mark where numeric digits may be placed and L mark the position of constant characters. View the online documentation for a table of available control characters. In the form editor, select Help -> Help. In the Find tab, search for “edit mask” and open the result General. On the help page, scroll through the contents to find the information on the Edit mask. The Edit mask contains the default characters for each of the positions. Note that to ensure that the pattern is enforced, Strict format in the General tab must be set to Yes.

After you finish placing the elements on the form, you should set the Tab Order (or the tab ordering). The Tab Order determines the order in which the fields are focused when the user is pressing the TAB key. To change the Tab Order open the General tab in the property editor any of the controls.

The Tab Order field configures the order in which form elements gain focus.

On the Tab Order field, click on the button to the right. This should bring up the Tab Order dialog. In most cases, Automatic Sort will place the elements in the correct order. Note that if you can continue to edit the form, by rearranging, removing or adding new elements, you should check this dialog again to ensure that ordering of the focus remains correct.

Along the toolbar at the bottom, there is a Design Mode On/Off button. Using this button will allow you to quickly test your form as you are editing it. Alternatively, you could also reopen your form. A navigation toolbar should appear along the bottom. Using the toolbar, you should now be able to view, add and modify the entries.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: