[Solved] Drop down list and look-up query

Discuss the database features
Post Reply
DtM
Posts: 3
Joined: Wed Apr 09, 2008 6:42 pm

[Solved] Drop down list and look-up query

Post by DtM »

I am having a challenge with migrating to Base (Ooo version 2.0) from Access and programming a drop down list. Hope someone can offer insight.

I have a form for the input of bibliographical citations. Each of the citations is entered bilingually French and English. Each of the citations is arranged under headings/sections that I want selected from a drop down list. I have a table as the source for the drop down list. A row from the table looks like this:

Code: Select all

  id |   categ_en    | categ_fr
  1  | Book Chapters | Chapitres du livre
[Sorry if this is was garbled. By the way I read the FAQ, BBCode table feature does not offer multiple columns.]

Coding objectives:
  1. By making a choice in English, the same choice for the French category is displayed in the French field as well
  2. By making a choice, the relevant section is stored in the table of citations under the same field names - categ_en or categ_fr
  3. As well, by making a choice, the ID is stored in a field (called cat_id) of the citation table.
I tried doing this with the wizard but can not get it work properly. As I mentioned, this is a migration from Access and already have data in the citations table. The appropriate category is displayed in the English field but not the French field. The field for the ID in the citation table is empty for new records that are added.

If anyone can point me in thr right direction, it would be greatly appreciated.
Last edited by DtM on Wed Apr 16, 2008 6:02 pm, edited 1 time in total.
User avatar
DrewJensen
Volunteer
Posts: 1734
Joined: Sat Oct 06, 2007 9:01 pm
Location: Cumberland, MD - USA
Contact:

Re: Drop down list and look-up query

Post by DrewJensen »

OK - if I am following correctly:

You would create a form that has 2 list boxes. lbxEnCat and lbxFrCat let's call them.
Each would be bound to the same Cat_ID field in the Citations table.

The data for lbxEnCat would be supplied with a query of:
SELECT "categ_en", "id" FROM <Category_lookup_table>


For lbxFrCat the source would be:
SELECT "categ_fr", "id" FROM <Category_lookup_table>

Now when you select from either listbox the proper value is written to the table Citations.

Does that help?

Drew

ps - yes the BBCode for tables sucks...someone should fix that. (hmmm...ok, that would be me..sorry )
Former member of The Document Foundation
Former member of Apache OpenOffice PMC
LibreOffice on Ubuntu 18.04
DtM
Posts: 3
Joined: Wed Apr 09, 2008 6:42 pm

Re: Drop down list and look-up query

Post by DtM »

Thanks for the input, Drew. That helped.
User avatar
Hagar Delest
Moderator
Posts: 30971
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Drop down list and look-up query

Post by Hagar Delest »

DtM wrote:By the way I read the FAQ, BBCode table feature does not offer multiple columns.
Only workaround is to use the Code BBCode (see what I've done to your post).

Thanks to add '[Solved]' at beginning of your first post title (edit button) if your issue has been fixed.
LibreOffice 7.4 on Xubuntu 22.10 and 7.4 portable on Windows 10
Post Reply