Combobox with subform for multiple entries.

Creating and using forms
Post Reply
Maax555
Posts: 127
Joined: Tue Mar 28, 2017 11:56 am

Combobox with subform for multiple entries.

Post by Maax555 »

Hi, I have a form ECNListByCustomer. Currently I am adding the ECNList references in a separate ADD NEW ECN-RFQ form. I would like to simplify matters and have only one form, the ADD NEW ECN-RFQ form.
At the same time it would be hugely beneficial to be able to add PartNumbers associated with the RFQ Reference.
So I am struggling to merge the two forms and make the ECNDetails subform a form to add new PartNumbers and not just show the existing ones.
So the new form lets call it RFQbuilder would be the same as ADD_NEW ECN-RFQ with the following changes,
1) Customer would be chosen first from listbox first this would restrict the RFQ references listed (as in the ECNListByCustomer form).
2) The RFQ Reference field would be a combobox and and would create a new entry if it did not already exist.
3) The ECNDetails or similar subform would allow PartNumbers to be added to the existing PartNumbers.
4) the other fields would remain the same.


I thought it best to show the entire picture of requirement for this form rather. I am happy to receive any advice and help step by step which would help me learn a little at a time.

I have had some of the above working separately, like the partnumber entry in the subform. However bringing them all together has been beyond my very limited capabilities.

Download link http://www.mediafire.com/file/vrl3dj76p ... 0V1.15.odb
Last edited by Maax555 on Thu Apr 12, 2018 3:51 pm, edited 1 time in total.
Regards Maax
LibreOffice 6.1.4.2 on Windows 7
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Combobox with subform for multiple entries.

Post by Villeroy »

The tutorial section of this forum describes everything you can do with Base forms. Subforms and list boxes can emulate one-to-one, one-to-many and many-to-many relations of a consistently designed relational database.
A combo box is just a text box with auto-complete. It stores the any text in one field of the current record.
All office documents consist of zipped XML. They are compressed archives already.
The SQL command SHUTDOWN COMPACT reduces the size of a HSQL database.
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
Maax555
Posts: 127
Joined: Tue Mar 28, 2017 11:56 am

Re: Combobox with subform for multiple entries.

Post by Maax555 »

Thanks. I will check out the shutdown compact command and try to upload. I have looked through tutorial, searched through examples and looked for similar posted questions, however I have not found anything that I have been able to adapt for my needs. Hopefully my uploaded database will encourage further advice.
Regards Maax
LibreOffice 6.1.4.2 on Windows 7
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Combobox with subform for multiple entries.

Post by Villeroy »

2) The RFQ Reference field would be a combobox and and would create a new entry if it did not already exist.
What if the RFQ has more than one mandatory attribute? A combo box takes only one text and writes it to one field.
In order to create a new record, you can create another form on the form document (not a subform) with all attributes, set the "new record only" property together with a button to add the next new record (property action = new record).
Then go back to your list box and click the second refresh button ("refresh control" which refers to a list or combo box). now you can pick the recently entered RFQ with all its attributes from the list box.

viewtopic.php?f=21&t=88831 has a link to an example form (movies_5.odb) and a tiny Python macro which allows you to set up an auto-refresh mechanism. The screenshot there shows 2 separate forms independent from each other. The first one is a main form with a subform and a sub-subform. The second one adds a new movie with all its attributes to the database which can be then referred to by the other form/subform.
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
Maax555
Posts: 127
Joined: Tue Mar 28, 2017 11:56 am

Re: Combobox with subform for multiple entries.

Post by Maax555 »

viewtopic.php?f=21&t=88831 has a link to an example form (movies_5.odb) and a tiny Python macro which allows you to set up an auto-refresh mechanism. The screenshot there shows 2 separate forms independent from each other. The first one is a main form with a subform and a sub-subform. The second one adds a new movie with all its attributes to the database which can be then referred to by the other form/subform.
Looking at this now. Have also added link to original post.

Thanks
Regards Maax
LibreOffice 6.1.4.2 on Windows 7
Post Reply