Issue Related to Save and Refresh Button question !

General discussion on OpenOffice Base and its databases.

Issue Related to Save and Refresh Button question !

Postby Jill R. Lipe » Tue Jul 29, 2014 8:45 am

Hi All,

Can someone please explain the reasoning for placing buttons on a certain form in a multi form (MainForm and SubForm) situation?
I still do not quite understand the principles.
Attached a very nice example database, provided by DACM, with multiple refresh and save buttons.

I have been experiementing with the placement of these buttons in different (sub) forms to see what there function is and what the result is, but no clear pictures is emerging.

Thanks in advance,
Jill R. Lipe
Posts: 33
Joined: Mon Mar 24, 2014 6:30 am

Re: Issue Related to Save and Refresh Button question !

Postby Tansenn » Tue Jul 29, 2014 11:40 am


So, at the top of the form there is a place to select a project number and then see the details (company name, address, service, and start time) of that project. When the listbox selection is changed, nothing happens. The form has to be refreshed before the details will match the selected project number.

You could put the refresh button in the same form as the listbox, however if that is done everytime the button is hit a popup window will appear saying "the contents of the form have changed, do you want to save the changes before refreshing?" (or some language like that). If instead the refresh button is put on a subform, it will refresh both the subform and the parent form with no annoying popup windows, and this is what DACM has done.

In the top form still, it is possible to change the start date, start time, and service type of the project. If you changed the date or time and then closed the form, a popup box would appear saying "the content of the current form has been modified, do you want to save your changes?" If instead you press the 'save' button and then closed the form, you would avoid the popup box.

Also, when using the form, any date/time or service type changes are automatically saved when the record being viewed is changed (when the project number in the listbox is changed and then the refresh (->) button is pressed), however many people feel more confidence in their data being saved if they are able to push a button that says "save".

The company name and address are not editable in the top form. The bottom form is used for this purpose. When a company name is selected, no changes are made to the address listbox; the form has to be refreshed. After the refresh button is changed, the bottom listbox is populated with the addresses related to the selected company name. Again, the button is placed on the subform to prevent the annoying popup boxes. Actually, this button does the exact same thing as the other refresh button, but it is convenient to the user to have a button next to each listbox being interacted with.

The "display results" button is a refresh on the main form - after a different address is selected at the bottom, pressing this button shows the address at the top. I think the popup is avoided because the change was made in the subform and not in the mainform.

The save button in the bottom part of the form does the same thing as the save button in the top part of the form, again having one in both areas just for convenience for the user.

Does that help?
Posts: 28
Joined: Tue Mar 25, 2014 6:27 am

Re: Issue Related to Save and Refresh Button question !

Postby Ricky G. Marion » Tue Jul 29, 2014 11:45 am


In relation to general principles, Button form controls (with "Form refresh" and "Save record" actions) are sometimes added to form documents to overcome the limitations of the AOO Base GUI.

For example, the GUI will update the record-set in any sub-form when the form document is first opened, and thereafter whenever the record pointer in the parent form is moved - the sub-form is refreshed with an updated record-set to reflect matching values in each form's respective linking fields.

It means, however, that merely changing value(s) in the parent form's linking field(s) does not of itself trigger the GUI to refresh the sub-form(s) record-set. It requires a change in the parent form's record pointer: even saving changed field values in the parent's record does not trigger a refresh of its sub-form(s).

Where the parent form is primarily designed for the entry of filtering criteria, the underlying data table often comprises a single record. Simply changing and saving data in that form causes no change in its record pointer, so the GUI fails to refresh the sub-form(s). One solution is to add a button form control with its Action property set to "Refresh form" to each of the sub-form(s). A side-effect of using this refresh button in any sub-form is both to update the sub-form and to save to the database the parent form's record should it still be unsaved: a single button performs both tasks.

There may still be occasions where a "Save Record" button may be required to supplement the GUI. These, however, tend to be specific requirements in (possibly overcomplex) data forms, and are seldom relevant to cascading filters.

Ricky G. Marion
Posts: 25
Joined: Mon Mar 24, 2014 6:33 am

Re: Issue Related to Save and Refresh Button question !

Postby Jill R. Lipe » Tue Jul 29, 2014 11:49 am

Thank you both for this explanation.
This is exactly what I was looking for..
Thanks again,
Jill R. Lipe
Posts: 33
Joined: Mon Mar 24, 2014 6:30 am

Return to Base

Who is online

Users browsing this forum: No registered users and 0 guests