How do I synchronise my form to my table?

Creating and using forms
Post Reply
User avatar
RhinoCan
Posts: 80
Joined: Fri Jun 10, 2011 11:36 pm

How do I synchronise my form to my table?

Post by RhinoCan »

I created a table called Sales_Tracker and put the first 10 rows into it via the Table View. That didn't present any problems.

Then I created a form called Sales_Tracker_Input that I intend to use to add the additional rows and edit the existing rows. The form is working to my satisfaction since it has appropriate controls on it for the four columns in the table and those controls have appropriate minimum and maximum values and formats.

I used my new form to add several new records; each time, the count of records in the table increased by 1, as I would have expected. But then something odd happened. I went back to my table and none of the new rows appear in it. I closed and reopened the table and also refreshed but only the old rows are visible when I look at the table in Table View.

I went back to the form and it only showed me the original 10 records, even though there had been almost 20 before I'd gone into the Table View.

When I go back to the form and try to add the 11th record, it refuses because it says this is a duplicate but it is NOT a duplicate of any of the original 10 rows in the table. It is a duplicate of the first record I added with the form. It seems as if the new records I added with the form are both there and not there! They are not visible but Base apparently still sees them because it is perceiving a record I previously added as a duplicate, which means it must still see the record somehow.

I've got extensive experience with DB2 and if I experienced this kind of behaviour in DB2, I would suspect that my updates hadn't yet been COMMITed. In other words, the new records are in limbo: the records have been created but won't be visible in the Table View until I do the Base equivalent of a COMMIT. If that is the case, I would dearly love to know how to do a COMMIT in Base. I've clicked on the Save button but it appears I need to do more before I can see my new records in the Table view. Can someone tell me what I need to do?

Or am I drawing an inappropriate parallel between Base and DB2? Is there another explanation? What do the rest of you do after creating records via a form to make those records visible in your tables? It seems there's something I need to do in either the Form or the Table to make my new records visible. I'd appreciate your guidance.
OpenOffice 4.1.2 and Libre Office 5.2.3.3 on Windows 10
F3K Total
Volunteer
Posts: 1038
Joined: Fri Dec 16, 2011 8:20 pm

Re: How do I synchronise my form to my table?

Post by F3K Total »

A guess: You missed to define a primary key in the table?
R
  • MMove 1.0.6
  • Extension for easy, exact positioning of shapes, pictures, controls, frames ...
  • my current system
  • Windows 10 AOO, LOLinux Mint AOO, LO
User avatar
RhinoCan
Posts: 80
Joined: Fri Jun 10, 2011 11:36 pm

Re: How do I synchronise my form to my table?

Post by RhinoCan »

No, the table has a single-column primary key. The form actually cites the primary key when it refuses to let me re-insert the 11th row.
OpenOffice 4.1.2 and Libre Office 5.2.3.3 on Windows 10
F3K Total
Volunteer
Posts: 1038
Joined: Fri Dec 16, 2011 8:20 pm

Re: How do I synchronise my form to my table?

Post by F3K Total »

Sorry, i don't understand, can you provide that file?
R
  • MMove 1.0.6
  • Extension for easy, exact positioning of shapes, pictures, controls, frames ...
  • my current system
  • Windows 10 AOO, LOLinux Mint AOO, LO
User avatar
MTP
Volunteer
Posts: 1620
Joined: Mon Sep 10, 2012 7:31 pm
Location: Midwest USA

Re: How do I synchronise my form to my table?

Post by MTP »

When you leave a row after editing some information, Base will COMMIT the edited row (or refuse to let you leave the row if a constraint is violated by the edits). This is true both in tables and when editing a table through a form (although often the error message is absent or less helpful if something inappropriate happens in a form).

The HSQLDB program that manages the tables is, by default, zipped inside Base. HSQLDB will maintain a .log file of all transactions made since the Base file was opened. When the file is closed (or, sometimes, not until all of OpenOffice is closed - the zip format is a little buggy) HSQLDB will write everything from the .log file into the main .data file before zipping everything back into the Base file. You can force the .data file to be updated by going to Tools->SQL and entering the command CHECKPOINT.

I don't think either of those things is the problem. I suspect there is something going on with how the form or a subform is connected to the tables. These kinds of things are really difficult to diagnose with just a behavior description. As F3K suggested, if you can upload the file, or a sample with sensitive information removed, we'll have a much better chance at finding the problem. (If you use the "PostReply" button there is a "Upload File" tab under the text box.) If the sample file is too big for the forum, you could post a download link to DropBox or MediaFire or similar.
OpenOffice 4.1.1 on Windows 10, HSQLDB 1.8 split database
Post Reply