Jim You stated that you could generate a query to do what you require. Have you based your form on the query? Alex On Sunday 23 Feb 2014 10:05:11 Jim Seymour wrote:
Alex, Thanks for the follow-up. Ideally there'd be one form for the asset(s), wherein each value could be entered or altered, the ones being foreign key references presenting a list from the desired column in the table to which the FK references. For example: I can do an ad hoc query that looks roughly like select ..., s.desc as "status", ... from hdwr_assets h left join hdwr_status s on s.status_id = h.status_id...; and a field named "status" will show in the output. Ideally, I'd like to be able to do that. In fact: I *can* do that in Queries -> Create Query in Design View), but not in a form? Behind the scenes: When you clicked on a list box for "status" in the assets form, a list derived from "descr" in the status table would be presented. When a selection is made, the related status_id value would be placed in the status_id field for the selected hardware asset. A sub-form would (could?) be presented, allowing one to alter the status table. Btw: When I try to associate hdwr_assets.status_id to hdwr_status.status_id using the Forms Wizard, execution results in Error: The data content could not be loaded. Error: SQL Status: 22023 The column index is out of range: 1, number of columns: 0. Information: The SQL command leading to this error is: SELECT * FROM "public"."hdwr_status" WHERE ( "status_id" = :link_from_status_id ) Which is not valid SQL. I would have thought this functionality would be present. Even the most basic of database normalization in the most trivial of databases is going to result in multiple tables and FK references. Thanks, Jim On Sun, 23 Feb 2014 09:22:32 +0000 Alex McMurchy <mcmurchy1917-libreoffice@yahoo.co.uk> wrote:Jim Is it that you want a single form, comprised of sub forms, whereby you can filter assets according to their status i.e. "deployed" or "in stock"; from the results given select a specific asset which presents the result, of that one asset, in a sub form from which the asset can be amended? Alex On Saturday 22 Feb 2014 13:11:52 Jim Seymour wrote:Hi There, I've researched and experimented with this, and I'm out of ideas. For starters: LibréOffice 3.5.7.2, Build ID: 350m1 (Build: 2) Before anybody suggests a newer version: I'm currently on Ubuntu 10.04 LTS (Lucid Lynx), so I'm stuck with it. (Even my much newer Linux Mint desktop install at work is still 3.x, I believe.) I have a database with a couple tables, as in create table hdwr_assets ( atag text primary key, serno text unique, status_id int references hdwr_status, . . . ); -- e.g.: "deployed", "in stock" create table hdwr_status ( status_id serial primary key, descr text not null, ); The plan was to create a form that could query and alter hardware assets, selecting values for status_id from a drop-down list, the available selection being from the hardware status table. Near as I can tell: The Forms Wizard simply isn't that smart? Interestingly: A Query created in Design View DTRT, wrt FK references, but I can't persuade the Forms Wizard to do so. In fact: FK references in the Forms Wizard appear to be thoroughly broken--at least in the version of LO I have? Is there any way to accomplish what I want, or am I going to have to resort to Real Coding (Java, HTML+PHP+JS or whatever)? Thanks, Jim
-- To unsubscribe e-mail to: users+unsubscribe@global.libreoffice.org Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/ Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette List archive: http://listarchives.libreoffice.org/global/users/ All messages sent to this list will be publicly archived and cannot be deleted