Controls greyed out on forms

I am using LO 7.3.7,2 in Linux Mint 21.2
I have 1 database where just recently, about 6 weeks ago, the controls to add new record , delete record and save record are all greyed out.
I have tried:
Editing the form, no luck
Creating new forms, only 1 form showed the said controls, while the other 2 didn’t
Creating a new database then copying the tables and queries, but the data didn’t copy over to the new database.
Searching on this site for relevant answers and possible solutions, but none of them worked for me, in that the data from the old table did not copy over to the new table.
I tried copying and pasting to a blank calc sheet, but again the data did not copy over to the said sheet.

It would seem that the only way it can be done is to copy and paste line by line, or record by record, which is a lot of time and work for me.

Have I missed something or done it completely wrong, as I am at a loss now.
I cannot understand why 1 new form had the said controls enabled , but 2 other new form did not.

I have checked the tables to make sure they all have an ID, and are set to AutoValue, they are.

Thanks

  1. Try to input content in the tables.
  2. If you are using queries as data source for the forms: Try to input content in the query.

What database do you use? Have a look at the status bar of the opened Base file. Most databases will show “Embedded HSQLDB” there…

I can input new data / records in both the tables and queries, no problem , but not the forms.
Yes it does show “Embedded HSQLDB” in the status bar.

Thanks

Could you upload the Base file here? Shouldn’t contain personal data.

No personal data included, only money and usage of utilities figures.
Thanks
EONUtilities.odb (96.2 KB)

  • Form “EONGas”: Data couldn’t be written in query, which is data source.
    Same with “fFuelCost”, “fmTotalsBoth”, “fmUnion”.

  • Form “fmEONElectric”: Data could be changed
    Same with “fmFuelPayments”.

Now lets have a look at the queries, because forms work as expected.
You created qryEONGas as a query, which has a subquery as datasource. Base GUI couldn’t create an editable query for this construction.

SELECT "ID1", "Date", "KWH Used", "Unit Cost", "Standing Charge", "No Days", 
"KWH Used" * "Unit Cost" / 100 AS "GAS Cost", "EPG", ( "KWH Used" * "Unit Cost" / 100 ) - ( "EPG" ) AS "Cost After EPG", 
( "No Days" ) * ( "Standing Charge" ) / 100 AS "Total Standing Charge", 
( ( "KWH Used" * "Unit Cost" / 100 ) + ( "No Days" ) * ( "Standing Charge" ) / 100 ) * 0.05 AS "VAT", 
( ( "KWH Used" * "Unit Cost" / 100 ) + ( "No Days" ) * ( "Standing Charge" ) / 100 ) * 0.05 + ( "KWH Used" * "Unit Cost" / 100 ) + ( "No Days" ) * ( "Standing Charge" ) / 100 AS "Gas Sub Cost", 
( "KWH Used" * "Unit Cost" / 100 ) - ( "EPG" ) + ( "No Days" ) * ( "Standing Charge" ) / 100 + ( ( "KWH Used" * "Unit Cost" / 100 ) - ( "EPG" ) + ( "No Days" ) * ( "Standing Charge" ) / 100 ) * 0.05 AS "Gas Total Cost ", 
( ( "KWH Used" * "Unit Cost" / 100 ) - ( "EPG" ) + ( "No Days" ) * ( "Standing Charge" ) / 100 ) * 0.05 AS "Reduced VAT" 
FROM "EONGas"

This query above will be editable. You could input data.

There are two table as source for “qryFuelCost”. Primary key from both tables has to be content of the query. Without both primary key it won’t be editable.

Query “qTotalsBoth2” couldn’t be filled with data, because it is executed by direct SQL, not through GUI form Base. It would work without this direct mode, but the layout will be destroyed then. Also there are primary keys missing for the tables and there are many subqueries as datasource. Thin it never would be used for input data. Same with “qUnion”.

Ok thanks for that. What I can’t understand is that the said database with the tables, queries and forms all worked fine for many months, then at the end of last year 2 of the forms became uneditable. I didn’t change anything as I didn’t need to.
Actually, what happened was that several months ago, 2 of the queries didn’t do certain calculations, but had done upto that time. I posted the problem on this site , and I was told I needed to use a subquery , Why, when I didn’t need to before. Anyway, I did that, and the calculations then worked again. Now it seems I shouldn’t have done that.

Thanks

I have just copied the sql code? into my old EONGas sql query , tried it and there is a syntax error somewhere

See “Abfrage1”:
EONUtilities.odb (96.1 KB)

@avvy651,
.
there are a number of rules which should be followed when creating a database.
one of those rules is: do not store calculated values.
.
you have 2 tables “EONElectric” and “EONGas” both of which are designed to store calculated values.
.
you have also designed 2 forms “fmEONElectric” and “EONGas” which are used for input.
.
I copied the table “EONGas” to “tEONGass” excluding the calculated fields, there are 7 columns including PK.
.
I copied the form “EonGas” to “fEONGass”.
.
I wrote 1 query “qEonGassCalcs” which makes the necessary calculations (which I simplified) and saved it in direct mode, it has 7 calculated fields plus PK.
.
I created a view “vEonGassCalcs” from the query.
.
your form has 1 inner form “Mainform”
I created 1 sub-form linked to “Mainform” via “ID1” (the PK) and dragged the controls which show the calculated fields into the sub-form.
.
data source for “Mainform” is the table “tEONGass”.
data source for subform is “vEonGassCalcs”.
.
I input 2 records in order to ascertain integrity and although irrelevant added a few records to your calendar table which had expired.
.
it should be fairly easy for you to duplicate my alterations and apply them to table “EONElectric” and form “fmEONElectric”.
Utilities.odb (108.6 KB)

Thank you for your time and help with my problem.
I will have a look at Utilities.odb when I have more time, although EONUtilities.odb works well enough or as I wanted it to.

As i previously mentioned, I don’t understand why these problems occurred when the said database was working fine before???

Thanks again.

I don’t know what happened but but both databases you provided for me, have now gone to 0 bytes, after I spent some time modifying the forms etc and adding more data. Now I don’t have either databases, except the downloaded ones. I am not inclined to do anymore modifications etc to either one now in case they also disappear to 0 bytes

Did LO crash?

Well it didn’t seem to want to save any new data etc, because it continually asked if I wanted to save it, and finally after many attempts to do so, I then just said No , to save. So , yes LO probably did crash. The thing is though, LO crashed with 2 databses, 1 twice.

Internal databases aren’t very safe for data. If you are using Base together with an external Firebird file (or an external HSQLDB-folder) data will be saved if changed any row. So a crash of LO won’t mean dataloss in the database.

Can be an issue with the rights to write in the folder where the databases are opened?

Could you point me to a tutorial on using external Firebird file or HSQLDB folder, as this is something I could do with. I have another database with over 8500 records, and don’t want to lose them.

Actually this is the first time this has happened to me in the 6 / 7 years I have been using LO, but there i a first time.

Thanks

@avvy651 : It is described a littel bit in English documentation | LibreOffice Documentation - LibreOffice User Guides (Base Guide). It is (nearly complete) a translation of Handbücher | LibreOffice Documentation - LibreOffice User Guides (Base Handbuch). I will update the Base Handbuch to the release of LO 24.2. at the end of this month.

Thanks, and I have installed firebird-server 3.0, following a YT video,
I’ve got as far as this:

rob@rob-Z97-HD3:~$ sudo isql-fb
Use CONNECT or CREATE DATABASE to specify a database
SQL> connect \Documents\base\LeedWXData.odb
CON> connect \Documents\base\LeedWXData.odb
CON> connect \Documents\base\LeedsWXData.odb
CON> user ‘SYSDBA’ password ‘masterkey’ ;
Command error: connect \Documents\base\LeedWXData.odb
connect \Documents\base\LeedWXData.odb
connect \Documents\base\LeedsWXData.odb
user ‘SYSDBA’ password ‘masterkey’
SQL>

So at this point , is my existing database connected to firebird, and what exactly happens after I add more data or records.

Thanks

@avvy651 : You won’t need a server.

  1. Set experimental features on.
  2. Create an internal Firebird database.
  3. Set experimental features off.
  4. Open internal Firebird database.
  5. Have a look for firebird.fdb file in you temporary folder. It should be in a subfolder together with firebird.fbk.
  6. Copy firebird.fdb file to a location where you want to save your data.
  7. Close the internal Firebird database connection.
  8. Create a new connection to an existing database. Choose Firebird file here.
  9. Connect to the file and you have an external Firebird database without server.

You will need a server if you want to connect to the database file with more than one user at the same time. Standalone user could also work with the Firebird file. But: Firebird file isn’t password protected. This could be done by a server connection.