[Solved] Can't change data in form

Creating and using forms
Post Reply
BrianME
Posts: 18
Joined: Sun Jan 03, 2021 9:30 pm

[Solved] Can't change data in form

Post by BrianME »

I've got a form that is based on a query so I can find a desired record and update it. It all works great, so I made a new query to find all the records of a particular client. The query works as expected. I then copied a form that I use for data entry, only this one uses the query. When I open the form, it asks for the client name and the form is populated with all the correct data and I can scroll through all the records associated with that client. But I can't change any of the data. I've looked at the form control and it's set for changes (Allow additions, allow modifications, allow deletions).

Is it because the query uses data from two different tables? Or because the form has multiple records after the query runs? (can't be that because the other form I have can have multiple records after the query search and it allows changes). I've looked at the controls of the two forms and don't see any differences.

Help?!
Last edited by BrianME on Fri Feb 26, 2021 9:53 pm, edited 1 time in total.
OpenOffice 4.1.7 on Windows 10
UnklDonald418
Volunteer
Posts: 1546
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA

Re: Can't change data in form

Post by UnklDonald418 »

For table data to be edited, the HSQL database engine requires the Primary Key value to identify which record to update.
Does the query include the Primary Key for the table you want to edit?
Does the form have a control for the Primary Key for the table you want to edit?
The form control containing the Primary Key can be hidden from the user but it must exist on the form.
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
BrianME
Posts: 18
Joined: Sun Jan 03, 2021 9:30 pm

Re: [Solved] Can't change data in form

Post by BrianME »

Wow, such a simple thing. Added the key to the list of fields in the query, never do anything with it, but it solved the problem.

Thank you!!!!!!!!
OpenOffice 4.1.7 on Windows 10
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: [Solved] Can't change data in form

Post by Villeroy »

UnklDonald418 wrote:Does the form have a control for the Primary Key for the table you want to edit?
The form control containing the Primary Key can be hidden from the user but it must exist on the form.
Nope. No form control needed if the primary key is an auto-value. Just include the field in the form's data source.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Post Reply