Re: Contents of formatted field vanishes when new data is entered into form

Andreas Saeger <[email protected]> Sat, 12 Dec 2009 11:42:32 +0100
Newsgroups gmane.comp.openoffice.dba.user
Message-ID <[email protected]>
Michael Hunold wrote:
> Hello all,
> 
> http://www.mihu.de/foo.odb
> 
> In my sample database "foo.odb" I have created a table "foo", with
> fields "nr" (primary key, auto-increment) and "foo" (integer).
> 
> Then I added a query "sum_of_foo", which, well, calculates the sum of
> field "foo".
> 
> Then I created a form "from". This has a table control which references
> to table "foo". Next I created a subform below the main form and
> connected it to "sum_of_foo". Then I added a formatted field and made it
> display the "sum_of_foo".
> 
> Now when I open up the form, I can see the entries in the top and the
> formatted field shows the sum of row "foo". When I change entries and
> press "Enter", the sum is updated accordingly.
> 
> But, when you move the cursor to the row with the "Star" so that you can
> add a new record, then the sum vanishes from the formatted field.
> 
> When you press "Enter" to confirm the new record, you can see that the
> formatted field is updated , but the result is quickly erased again. If
> you move the cursor away to an existing record, the sum vanished again.
> 
> Is this a bug or a feature? Did I do something wrong when setting up the
> subform or the query?
> 
> You can download the sample database using the link mentioned above.
> 
> Best regards
> Michael.

A subform shows some data (calculated or not) that relate to the parent 
form through some common field(s).
For instance: parent form shows some article, subform shows the sum of 
all sales having the same article-ID as the parent form's currently 
selected article.
While entering a new article into the parent form, the subform does not 
get any article ID until the parent form's new record has been stored to 
disk.