Page 1 of 1

[Solved] Form not clearing when adding new record?

Posted: Wed Dec 14, 2022 1:26 am
by mrSteven2k22
Hey there,

I must have missed something when creating my form. (Btw I am new to using open office base)

I have created all the tables how I need them to be, and have created the forms. Now the only problem I have is that when I finish adding and save my record, the next new record does not clear. And copies all of the data I entered from my previous record into my new record and get mixed up with the old record?

I hope this problem makes sense as I have described it

Any help would be appreciated thank you.

Re: Form not clearing when adding new record?

Posted: Wed Dec 14, 2022 8:02 am
by UnklDonald418
Welcome to the Base Forum.
It is difficult to give advice with only a description of the problem. It is much better to upload a sample database demonstrating the problem.
Here are instructions for uploading to this forum https://forum.openoffice.org/en/forum/v ... =74&t=8289

Re: Form not clearing when adding new record?

Posted: Wed Dec 14, 2022 2:04 pm
by mrSteven2k22
Thanks for your reply i have read the guidelines you linked and I will upload an example of the database I am using, the same way I have set up the one I will be using just different data of course 🤓

Re: Form not clearing when adding new record?

Posted: Wed Dec 14, 2022 3:43 pm
by mrSteven2k22
i am uploading an example of the database i have set up,

the same set up as the one i am going to actually be using,

on the database form i have pointed out (using red arrows) the fields that are not saving and getting mixed up when using next record or new record, to add new records
Example.odb
(14.25 KiB) Downloaded 287 times
the fields with the larger boxes on the form will contain large amount of text.

Re: Form not clearing when adding new record?

Posted: Wed Dec 14, 2022 8:38 pm
by UnklDonald418
Your Form document lacks navigation controls, so you are always stuck on the first record.
I added a Form document which uses a Navigation Bar which is the simple solution.
I added a second Form document using Push Button Controls. There are only 4 push buttons which is probably the minimum to be useful.
You could add more push buttons with other Actions if needed

Re: Form not clearing when adding new record?

Posted: Wed Dec 14, 2022 9:48 pm
by mrSteven2k22
The navigation and push button controls are useful thanks,

But the problem I am having is when I add text into the larger text boxes in the form, the data I enter is not saving

this issue is still occurring. I have pressed the save record button and tried using both the new record and next record button.

Every time I am in the new/next record the data from the previous entry is automatically entered. And when delete the text, it also deletes from the previous record aswell.

I need something that saves each record individually.

Re: Form not clearing when adding new record?

Posted: Thu Dec 15, 2022 6:23 am
by UnklDonald418
The VARCHAR data type does not support formatted text, so I changed the Text type to Multi-line for Sxx, Cxx and Rxx Nxx.
You can apply formatting to the Text Box controls, like I did to Rxx Nxx.
Including non printing characters in field names could come back to bite you. It is best to either eliminate the spaces or replace them with a printing character such as the_underscore.

The File Picker control saves the selection to an internal buffer which it displays and does nothing more.
It appeared to me that you wanted to save that selection in the field Vxx Fxx Lxx, so I included a little Macro that runs when a change is made to the text displayed by the File Picker.
The macro copies the text from the File Picker buffer into Vxx Fxx Lxx and then clears the File Picker buffer.
When you first open Example03 it may warn you that the file contains Macros, you will need to Enable Macros for the File Picker selections to be saved.

Be aware that an Embedded Base database has everything, Tables, Queries, Forms, Reports, Macros and a copy of an early version of the HSQL database engine all stored in the .odb file. That file is actually a Zip archive and if anything interrupts the Zip process the .odb file could become corrupt and all the data lost. It seems to happen most often to laptop users who shut their computer without allowing the Base database to fully close. But it can happen to anyone, so regular backups are very important!

For serious work that issue can be minimized by using a JDBC connection, sometimes referred to as a Split database where the Tables and a more recent version of the HSQL database engine are stored in separate files outside the .odb file. But there are side effects that can make development difficult for those unfamiliar with SQL, so usually it's best to start with an Embedded database and then once everything is working migrate to a JDBC connection.

Re: Form not clearing when adding new record?

Posted: Sun Dec 18, 2022 4:49 pm
by mrSteven2k22
this has worked 😎

⭐⭐⭐⭐⭐