Can't edit query results

Creating tables and queries
Post Reply
whitesand
Posts: 5
Joined: Fri Jan 09, 2009 3:55 am

Can't edit query results

Post by whitesand »

I am using Base 3.0 on XP.
I have been trying to figure out why I cannot edit the results of a simple query.

I attached an example odb that has two tables:
Table: Accounts
Fields: AccountID, Primary Key, Autonumber
AccountName, Text
AccounttTypeID, Interger

Table: AcctTypes
Fields: AccountTypeID, Primary Key, Autonumber
AcctType, Integer

One query: Query1
SELECT "Accounts".*, "AcctTypes".* FROM "Accounts", "AcctTypes" WHERE "Accounts"."AccountTypeID" =
"AcctTypes"."AccountTypeID"

I run the query and nothing is editable. This is as simple as I know how to make it and it still doesn't work. Can somebody explain?

Attachment:
Simple Query Edit Test.odb
Example - Yields Query results that are not editable.
(3.69 KiB) Downloaded 295 times
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Can't edit query results

Post by Villeroy »

Create a form based on a record set from one table, including the primary key (it's not necessary to create a visible control for the PK, if it is an auto-key).
Attach a subform to the form, based on the other record set, including PK. Linkd form and subform by their common fields (both "AccountTypeID" in your case).
Select a record in the main form and the subform selects the record(s) related to the main form's current record. Both are editable, given that both underlying record sets are editable.
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
whitesand
Posts: 5
Joined: Fri Jan 09, 2009 3:55 am

Re: Can't edit query results

Post by whitesand »

Villeroy,
Thanks for the quick response. Doing this through a form and subform. does not work for what I need to do. The purpose of this type of query is to allow me to build tables with indexes into tables of "Lists" that have the real values (text account names in the example). I need this concept over and over again and forms with subforms will just not work. The purpose is to build a nicely normalized database and use relations to get the text value for fields that are typically integer or alphabetical.

This particular simple example works as expected in Access. That is, the query results are fully editable.

I keep reading comments about queries should be editable if the tables have primary keys that are referenced in the query, but it appears there are other conditions/limitations. Can anybody tell me what those conditions are?

Surely there is a way to build normalized databases using Open Base.
OOo 3.0.X on Ms Windows XP
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Can't edit query results

Post by Villeroy »

I have no clue what you are after, but I think you can not use anything else but MS Access then.
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
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Can't edit query results

Post by Villeroy »

3 lists of persons, items, subitems each with name and ID number.
A set of relations where each person has one item (one-to-many relation) and arbitrary sub-items (many-to-many)
A form where persons can be associated with one item (1-n) and arbitrary sub-items (n-n) by means of ID-numbers, but the form does not show a single ID, just the names.
 Edit: The other forum's thread where the database originated from has some more details about the file (I'd better write such things directly into the form): http://www.oooforum.org/forum/viewtopic ... 022#311022 
Attachments
subitems.odb
persons, items, arbitrary sub-items
(11.65 KiB) Downloaded 396 times
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
whitesand
Posts: 5
Joined: Fri Jan 09, 2009 3:55 am

Re: Can't edit query results

Post by whitesand »

Villeroy,

I downloaded your example subitems.odb.

I looked at it briefly but I have to leave for a few hours so I can't work on it now. It looks like it is headed in the right direction. Later I will see if I can work with these techniques in my application.

Thanks again.
OOo 3.0.X on Ms Windows XP
Post Reply