Limiting Value of a Combo Box Based on another Combobox

Discuss the database features
Post Reply
JWMCC
Posts: 3
Joined: Mon Sep 03, 2018 12:37 pm

Limiting Value of a Combo Box Based on another Combobox

Post by JWMCC »

Hey there,
I'm new to open office and I'm trying to create a basic database for managing production changes. I'd like to be able to limit the contents of 1 combo box based on the value of another combo box on the same form. So in this case it's the control combo box is a list of customers, the 2nd combo box will be a list of products but I only want to see the products in combo box 2 that are linked to the selected customer in combo box 1.

E.g.
Customer 1 has products Prod A & Prod B
Customer 2 has products Prod X & Prod Y

I want to select Customer 1 in the Customer Combo box and the Product Combo Box only Show Prod A or Prod B
If I then select Customer 2 in the Customer Combo box and the Product Combo Box only Show Prod X or Prod Y

The resulting entry is then saved into another table with various other data.

For the products & Customers I have set up 2 tables:
Customer - has an index and the field Customer Name
Products - has an index & the fields: Customer Name, Product name, Product Description, Part Number

You create entries to the product list by completing a form set up which pulls the customer name from the customer table and inserts it to the Products table thus creating the 1 to many link.

I can create a query to test that I'm getting the right result but I don't know how to either base the 2nd drop down list (products) on a query or limit it. I can do it in access but not here, keen for some thoughts.
OpenOffice Ver 4.15 on Windows 10
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Limiting Value of a Combo Box Based on another Combobox

Post by Villeroy »

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
UnklDonald418
Volunteer
Posts: 1548
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA

Re: Limiting Value of a Combo Box Based on another Combobox

Post by UnklDonald418 »

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
JWMCC
Posts: 3
Joined: Mon Sep 03, 2018 12:37 pm

Re: Limiting Value of a Combo Box Based on another Combobox

Post by JWMCC »

Hi there, thanks for the reply, the only issue is I have no idea what the post is telling me to do, it looks like I need to set up a subform for customers & products and then put that into my main form?
ANy time I try to use a list box I don't get data showing up in the list, so really not sure how it's meant to work. Are there any functioning examples anywhere that i could see? this just seems harder than it needs to be!
OpenOffice Ver 4.15 on Windows 10
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Limiting Value of a Combo Box Based on another Combobox

Post by Villeroy »

Cascading listboxes are not supported. You have to use subforms or macro code in creative ways.
Base is not a databsae development suite. It is a tiny addition to the office suite. The whole office suite is a lot smaller than MS Access alone.
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
JWMCC
Posts: 3
Joined: Mon Sep 03, 2018 12:37 pm

Re: Limiting Value of a Combo Box Based on another Combobox

Post by JWMCC »

Villeroy wrote:Cascading listboxes are not supported. You have to use subforms or macro code in creative ways.
Base is not a databsae development suite. It is a tiny addition to the office suite. The whole office suite is a lot smaller than MS Access alone.
Ok thanks, so is there a proper tutorial or video or example I can see to do this?
OpenOffice Ver 4.15 on Windows 10
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Limiting Value of a Combo Box Based on another Combobox

Post by Villeroy »

This forum is full of tutorials and examples. We have a separate sub-forum for this: viewforum.php?f=83
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
UnklDonald418
Volunteer
Posts: 1548
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA

Re: Limiting Value of a Combo Box Based on another Combobox

Post by UnklDonald418 »

In case you haven't found this yet
Cascading list boxes with and without macros
You might also find the User Guides helpful.
https://wiki.openoffice.org/wiki/Documentation
The AOo guides are somewhat behind but Chapter 8 of version 3.3 Getting Started Guide describes the Base module.
LO has a Base Handbook that is more recent.
https://documentation.libreoffice.org/e ... mentation/
The fact that you don't understand list boxes and you have been using a combo box, which are not commonly used with relational databases, a tutorial on relational database design might be helpful.
https://wiki.documentfoundation.org/ima ... torial.pdf
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
Post Reply