Subform in new form

Creating and using forms
Post Reply
mihmih
Posts: 111
Joined: Wed Feb 18, 2015 9:21 pm

Subform in new form

Post by mihmih »

Hi,

i have a table (mainForm) and i want to add to some record another linked records just like in a form with subform. But i want to have this subform-table (adding, modify and delete records) in another form and open it by a button. Is maybe some simple macro to do that? I can not find any topic about it.... Thank you for any help.
LibreOffice 4.2 on Windows7
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: subform in new form

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
mihmih
Posts: 111
Joined: Wed Feb 18, 2015 9:21 pm

Re: subform in new form

Post by mihmih »

it is a simple open any form-macro if i understand...

i have 3 tables:

orders(id_o, orders_date)
junction_table(ID_j, ID_order, ID_product)
products (ID_prod, name, price)

and in form with table orders FOCUS is in one record. And i want to push a button and open a form, where i can add products to this order ( add data to junction_table without telling to the base any information about ID_order, just like in Mainform-subform in one FORM). Is it possible?
LibreOffice 4.2 on Windows7
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: subform in new form

Post by Villeroy »

It is impossible if you do not understand the solution in http://www.access2base.com/access2base.html (under Actions > Open Form)
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
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: subform in new form

Post by Villeroy »

Access2Base is a macro suite written in Basic and distributed as an extension. Install the extension and make use of hundreds of wrapper functions.
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
mihmih
Posts: 111
Joined: Wed Feb 18, 2015 9:21 pm

Re: subform in new form

Post by mihmih »

IS it so simple?


OpenForm(Addingproducts, , , ID_o = ID_order, , , )
LibreOffice 4.2 on Windows7
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: subform in new form

Post by Villeroy »

I don't know. I hardly use any database macros. Of course you need to be familiar with the Basic language.
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: 1546
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA

Re: subform in new form

Post by UnklDonald418 »

Perhaps this link may help you.
viewtopic.php?f=39&t=82622&p=382917&hil ... rm#p382917
Despite the misleading title for the topic, there is a macro to open (and close) a form using a button click.
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
UnklDonald418
Volunteer
Posts: 1546
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA

Re: subform in new form

Post by UnklDonald418 »

and in form with table orders FOCUS is in one record. And i want to push a button and open a form, where i can add products to this order ( add data to junction_table without telling to the base any information about ID_order, just like in Mainform-subform in one FORM). Is it possible?
You might be able to accomplish this using a filter form.
The first form can store the MainForm ID of "one record" in the filter table which can then be read by the second form.
The Filter table would probably only need two fields. You can execute the following SQL command to create the table

Code: Select all

CREATE TABLE "FilterTable" ( "FilterID" BOOLEAN PRIMARY KEY, "MainFormID" INTEGER);
Before using it you should probably open "FilterTable" and make sure the checkbox is checked.
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
UnklDonald418
Volunteer
Posts: 1546
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA

Re: subform in new form

Post by UnklDonald418 »

Also have you looked at this tutorial
viewtopic.php?f=100&t=56006
in particular the database Invoice_Forms_v2.odb
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