[Solved] Form not clearing when adding new record?

Creating and using forms
Post Reply
mrSteven2k22
Posts: 5
Joined: Wed Dec 14, 2022 1:13 am

[Solved] Form not clearing when adding new record?

Post 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.
Last edited by mrSteven2k22 on Sun Dec 18, 2022 4:46 pm, edited 1 time in total.
Open office 4 on Windows 10
UnklDonald418
Volunteer
Posts: 1551
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA

Re: Form not clearing when adding new record?

Post 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
If your problem has been solved, please edit this topic's initial post and add "[Solved]" to the beginning of the subject line
Apache OpenOffice 4.1.14 & LibreOffice 7.6.2.1 (x86_64) - Windows 10 Professional- Windows 11
mrSteven2k22
Posts: 5
Joined: Wed Dec 14, 2022 1:13 am

Re: Form not clearing when adding new record?

Post 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 🤓
Open office 4 on Windows 10
mrSteven2k22
Posts: 5
Joined: Wed Dec 14, 2022 1:13 am

Re: Form not clearing when adding new record?

Post 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 275 times
the fields with the larger boxes on the form will contain large amount of text.
Open office 4 on Windows 10
UnklDonald418
Volunteer
Posts: 1551
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA

Re: Form not clearing when adding new record?

Post 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
Attachments
Example02.odb
(35.64 KiB) Downloaded 281 times
If your problem has been solved, please edit this topic's initial post and add "[Solved]" to the beginning of the subject line
Apache OpenOffice 4.1.14 & LibreOffice 7.6.2.1 (x86_64) - Windows 10 Professional- Windows 11
mrSteven2k22
Posts: 5
Joined: Wed Dec 14, 2022 1:13 am

Re: Form not clearing when adding new record?

Post 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.
Open office 4 on Windows 10
UnklDonald418
Volunteer
Posts: 1551
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA

Re: Form not clearing when adding new record?

Post 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.
Attachments
Example03.odb
(37.45 KiB) Downloaded 266 times
If your problem has been solved, please edit this topic's initial post and add "[Solved]" to the beginning of the subject line
Apache OpenOffice 4.1.14 & LibreOffice 7.6.2.1 (x86_64) - Windows 10 Professional- Windows 11
mrSteven2k22
Posts: 5
Joined: Wed Dec 14, 2022 1:13 am

Re: Form not clearing when adding new record?

Post by mrSteven2k22 »

this has worked 😎

⭐⭐⭐⭐⭐
Open office 4 on Windows 10
Post Reply