Subform with button to open detail form. How to?

Creating and using forms
Post Reply
michaelcole
Posts: 1
Joined: Wed Nov 25, 2009 3:04 am

Subform with button to open detail form. How to?

Post by michaelcole »

Hi,

Imagine a Company has Departments which have People.

I'd like to make a main form for Company, with a table subform for Departments. No problem, use the wizard right.

However, if while on the Company form, the user wants to edit a Department, I'd like a "open detail" button in the Department sub-form.

This Department detail form has:
- one Department's data.
- more fields than I can fit in a single-row sub-form table
- it's own People sub-form (with it's own "open detail" button).

In Ms Access (in like 1997), I was able to do this, using a sub-form with "continuous layout" sub-forms.
In Access, sub-forms with a "table" layout couldn't have button controls (seems like same in OO Base). So, I'd create a sub-form with a "continuous" layout, that repeated itself in a scroll region. This sub-form had a button that kicked of some script to open the detail form to the right place.

Is this possible in OO Base? I've been looking all day, but haven't found it. I'd like to use Base instead of Access, but need this to accomplish the project.

Any ideas?

Mike
Openoffice 3.5.1 on Ubuntu 9.10
Arineckaig
Volunteer
Posts: 828
Joined: Fri Nov 30, 2007 10:58 am
Location: Scotland

Re: Subform with button to open detail form. How to?

Post by Arineckaig »

I have suggested a possible solution to your post in the other forum: see

http://www.oooforum.org/forum/viewtopic ... 759#349759
When this issue has been resolved, it would help other users of the forum if you add the word - [Solved] - to the Subject line of your 1st post (edit button top right).
AOOo 4.1.5 & LO 6 on MS Windows 10 MySQL and HSQLDB
RPG
Volunteer
Posts: 2261
Joined: Tue Apr 14, 2009 7:15 pm
Location: Netherlands

Re: Subform with button to open detail form. How to?

Post by RPG »

Hello

The OP in this thread did ask an example of a database. He did asked it in an other thread on the other forum.
I don't know if it can help him but the code is useful for people who want calculate in a grid but only on one row. This does not complete update.



I will warn users again who did not have work more with basic it can be to difficult.

Gridcontrol
In this example there is how to calculate in grid control using events and also ask something from a table using SQL. Also I use listbox in a grid control for updating the form. After update that field the row is calculate

Searching
There is an example for searching to records with two search box. Also this use events and timing.

The result of this searching can be used for a button to open a new form and go to the customers in the new form. This used filtering in a table.

Romke
Attachments
gridtable.odb
Example open form, search, calculate in grid
(37.34 KiB) Downloaded 942 times
Last edited by RPG on Thu Nov 26, 2009 12:34 am, edited 2 times in total.
LibreOffice 24.8.5.2 on openSUSE Leap 15.6
User avatar
Villeroy
Volunteer
Posts: 31365
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Subform with button to open detail form. How to?

Post by Villeroy »

Opening GridTable.odb wrote:The connection to the data source "GridTable" could not be established.
Error code: 1000

The driver class 'org.hsqldb.jdbcDriver' could not be loaded.
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
RPG
Volunteer
Posts: 2261
Joined: Tue Apr 14, 2009 7:15 pm
Location: Netherlands

Re: Subform with button to open detail form. How to?

Post by RPG »

Hello Villeroy

I did think I did use an embedded database but it is clearly not embedded.

I try to make an embedded version. That is more easy for other users.
thank you for warning
Romke
LibreOffice 24.8.5.2 on openSUSE Leap 15.6
RPG
Volunteer
Posts: 2261
Joined: Tue Apr 14, 2009 7:15 pm
Location: Netherlands

Re: Subform with button to open detail form. How to?

Post by RPG »

Hello Villeroy

I have change the file and hope it is now good. I always try that there are no erros for other people. But some time there are errors.

Thank you for warning.

Romke
LibreOffice 24.8.5.2 on openSUSE Leap 15.6
User avatar
Villeroy
Volunteer
Posts: 31365
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Subform with button to open detail form. How to?

Post by Villeroy »

Basic macros are a source of never ending trouble.
I load the "Search" form and type a "j" into the second list box.
I hear a beep, another form opens, the Basic IDE opens with error "method/property not found" in line 8 of module "Order".
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
RPG
Volunteer
Posts: 2261
Joined: Tue Apr 14, 2009 7:15 pm
Location: Netherlands

Re: Subform with button to open detail form. How to?

Post by RPG »

Hello Villeroy

It can be that basic is not the best language but enough for me. But that means not that errors are permits. There was an interupt in the form what was the reason of the error. I hope that there is no error more. The beep is still there and is rest of testing
Thank again and I have change the file again

Romke
LibreOffice 24.8.5.2 on openSUSE Leap 15.6
Post Reply