On 2022-10-31 03:17, Carlos E. R. wrote:
On 2022-10-31 02:26, Robert Webb wrote:
...
I hit tonight a new problem, though: in the form I have I can not create a new book entry.
In the top half of the form, the table like view, new record button doesn't respond, because it takes data from a Query and thus, it is read only.
In the bottom half of the form it does create a new record, yes, but the Index field displays "<AutoField>" and not a newly created index number. When trying to save the record, it says the number is a duplicate. I can not write a number by hand, either. I'm stuck there and have to close the form completely, without saving, to recover:
Error inserting the new record /home/abuild/rpmbuild/BUILD/libreoffice-7.3.6.2/connectivity/source/commontools/dbtools.cxx:747
Duplicate entry '374' for key 'PRIMARY' /home/abuild/rpmbuild/BUILD/libreoffice-7.3.6.2/connectivity/source/drivers/mysqlc/mysqlc_general.cxx:119
The issue is that as the top half query and bottom part are linked by the index number, it means that the bottom part can only display one entry, that whose index is highlighted in the top part. Attempting to create a new record is limited to that number, so creating a new index number doesn't work. Longer explanation here: <https://ask.libreoffice.org/t/lo-base-i-created-a-form-to-handle-a-table-but-can-not-create-new-record/83532/3> The way to get out of here is create the new record externally, so the obvious idea is to create a button that calls a form that does just that. Caveat: LO doesn't have a button to do just that (M$ Base does). It has to be done with custom code, or a macro. Fortunately the chap that was helping me knows this, and posted the code and instructions. Initially this failed, but he found out why, and now I have it working, and I just added the books that were still not in the database a few minutes ago. :-D -- Cheers / Saludos, Carlos E. R. (from 15.3 x86_64 at Telcontar)