How to achieve listbox content based on another field

Creating and using forms

How to achieve listbox content based on another field

Postby Maax555 » Wed Jul 11, 2018 4:42 pm

Ok, i have not posted on here for a while as i have tried to get this working myself without success.
I have supplied a link to my database in the hope someone can download and take a look as I just cant get it to work.
Any similar examples i can find just cant be adapted (by me) for my needs.
So in the Form PartNumber2 I have everything working ok apart from SimilarPart listbox and ReplacesPart listbox.

The idea is that after the customer has been chosen from the list box the red listboxes will be populated with a list of all PartNumbers related to the CustomerID. The two listboxes will have the same list in them to choose from. When the desired SimilarPart and ReplacesPart have been chosen the record can be saved and the details will update to the PartNumber2 table. I have supplied a Dropbox link for those who care (or should i say dare) to take a look.

I would very much appreciate someone taking a look as I have spent a serious amount of hours try to work this out.
many thanks.
If there is a better way to share the database please let me know.

https://www.dropbox.com/s/74bqrphnbz3oa6w/Project%20Tracking%20Test%20V1.17-RFQ.odb?dl=0
Regards Maax
LibreOffice 5.4 on Windows 7
Maax555
 
Posts: 54
Joined: Tue Mar 28, 2017 11:56 am

Re: How to achieve listbox content based on another field

Postby Maax555 » Thu Jul 12, 2018 3:15 pm

No takers yet:-(
Regards Maax
LibreOffice 5.4 on Windows 7
Maax555
 
Posts: 54
Joined: Tue Mar 28, 2017 11:56 am

Re: How to achieve listbox content based on another field

Postby RoryOF » Thu Jul 12, 2018 3:52 pm

If you have a subroutine to populate a listbox dynamically, it should be simple to pass the selection parameter from the first listbox to that subroutine to control its population.

The code snippet in this thread might be helpful
https://forum.openoffice.org/en/forum/viewtopic.php?f=21&t=3519
Apache OpenOffice 4.1.5 on Xubuntu 18.04 (mostly 64 bit version) and infrequently on Win2K/XP
14 October 2016 was Pooh's 90th birthday
User avatar
RoryOF
Moderator
 
Posts: 26778
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: How to achieve listbox content based on another field

Postby UnklDonald418 » Thu Jul 12, 2018 5:53 pm

I went to the link you provided and downloaded Project Tracking Test V1.17-RFQ.odb
So in the Form PartNumber2 I have everything working ok apart from SimilarPart listbox and ReplacesPart listbox.

I see no Form PartNumber2
When the desired SimilarPart and ReplacesPart have been chosen the record can be saved and the details will update to the PartNumber2 table.

Likewise, I find no PartNumber2 table.
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.5 & LibreOffice 6.0.4.2 - Windows 10 Professional
UnklDonald418
Volunteer
 
Posts: 847
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA

Re: How to achieve listbox content based on another field

Postby Villeroy » Thu Jul 12, 2018 9:48 pm

Cascading list boxes with macro code and links to solutions without: https://forum.openoffice.org/en/forum/v ... 83&t=46470
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 16.04, OpenOffice 4.x & LibreOffice 5.x
User avatar
Villeroy
Volunteer
 
Posts: 25443
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany


Return to Forms

Who is online

Users browsing this forum: No registered users and 3 guests