Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index

Hi Noel
I'm building a database for a fishing club. I have Member and Boat as two
of the many tables in the DB.
I have a form which shows my Member data and a sub form with the Boat data
of all the boats the member owns.
I used the wizard to produce this form. How did you establish the
relationship between your
two tables?
I linked the primary key in the Member table (equivalent to your Family
table) and a foreign key in the Boats table (equivalent to your Rolls
I did this by building the tables using SQL coding, including  expressing
the Constraints in SQL.showing the link between the foreign key in Boats
and the Member primary key.
My form shows the Member data in columnar form and the Boat data for the
member as a data sheet which includes all the boats owned by the member
which is what I think you want for your project.

On Thu, Jun 6, 2013 at 8:21 AM, Marion & Noel Lodge <>wrote:

Hi Dan,

My form displays a Church Membership Roll -

- The Families Table contains the family's Surname, Address, Street Map
Reference, Date Loaded, Date Last Updated etc.
- The Roll Table has a separate line for each family member.  It includes
First Name, Title, Date of Birth, Membership Status, Occupation etc.

On the form the family fields are displayed in Columnar format with labels
left.  The Roll fields are in a Data sheet.

When I call up a family I want all the family members to automatically
appear, and I was hoping to do that using Main form / Sub Form linking.

At the moment, by removing the linking, I can get all of the Roll table
rows appearing in the Data sheet, so I think I'll write a macro to filter
the rows to include only those associated with the currently displayed
family.  I think this would work just as well as the linking mechanism, but
can you think of a better solution?


Noel Lodge

On 6 June 2013 20:57, Dan Lewis <> wrote:

     It seems that this has been a problem since 2010 with
Base, so it is likely a problem with LibreOffice Base as well.
     This link describes how one person solved it.


     There is something more that I would like to know:
 1) What purposes do this form and subform serve? (Specifically, why use
the parameter?)
2) How does the design of the form accomplish these purposes?


On 06/05/2013 09:40 PM, Marion & Noel Lodge wrote:

Hi Dan,

Thank you for your prompt and detailed reply.

I'm using the H2 database and I suspect that was the vital piece of
information that I failed to mention in my first post.  Sorry about

I originally linked the two tables using the Wizard. Then later I used
Form properties dialog to un-link and then relink them, but to no avail.

When I got your reply, I created a new test Form going through all the
steps you laid out, but I got the same error message as before.

I then went to Queries | 'Create Query in SQL view' and ran this query -

WHERE ("FamilyKey" = :link_from_FamilyID)

With the SQL button on, (Run SQL command directly), I got the same
With the button off I got a prompt to manually enter the value of
':link_from_FamilyID'.  Entering a 1 produced the same error as before.

I finally tried the query in a native, (HSQL not H2) database, (I
the table name to suit the other database), and when I manually entered
suitable integer it worked!

So my conclusion is that setting Table links in a Base Form doesn't work
when using H2 as the database.  Is that right?

Thanks again for all your help - much appreciated.

Noel Lodge

On 5 June 2013 21:51, Dan Lewis <> wrote:

 Onn 06/05/2013 02:29 AM, Marion & Noel Lodge wrote:

I have a Form with families info in the Main Form and family members
in a Sub Form. The Tables and relevant fields are -
Main Form (Families)
<Info fields follow>

Sub Form (Roll)
RollID         BIGINT     IDENTITY
FamilyKey  BIGINT
<Info fields follow>

I have linked the forms using fields FamilyID and FamilyKey - a one to
link.  However I get the error -
The data content could not be loaded.
SQL Statement:
WHERE ("FamilyKey" = :[*]link_from_FamilyID) [42001-139]

The problem seems to be the 'link_from_FamilyID' phrase.  I Googled
and all it says is that it is an invalid SQL Statement, but I don't
what is wrong.  Even if I did, the SQL statement is generated by the
Wizard!  Is there a way of manually over riding the Wizard?  Failing
I'll need to write a macro to filter the Roll records to achieve what
want to happen.  But I shouldn't need to do this.  In another
have previously got this sort of linking to work.

Can anybody see what I am doing wrong here?

I'm running LO version and Windows 7.


Noel Lodge

       Needed information: How did you link these two tables?
steps please.) Are you using Base as the front end to another database?
Where did Base get the name "LUCROLLS"? (I know that "PUBLIC" is the
and 'Roll" is the table name.) Is "LUCROLLS" the name of the database
      I created a database with two tables: Families and Roll. Families
given the primary key, FamilyID (BIGINT). Roll was given two fields:
(primary key, BIGINT), and FamilyKey (BIGINT). Using the Form Wizard, I
created a form with Families as the main form and Roll as the subform.
2: (Setup sub form) Clicked "Add subform" box. Clicked Next. Step 3:
subform fields) Selected "Table:Roll" from the Tables or queries
list. Clicked the double right arrow to move all the fields from the
Roll, to the "Fields in form" list. Clicked Next. Step 4: (Get joined
fields) Select FamilyKey from the "First joined subform field"
list. Select FamilyID from the "First joined main form field" drop-down
list. Click Next. I then went through the rest of the steps of the Form
      Possible way to correct the situation: Edit the form.
Add the Form Controls toolbar. (View > Toolbars > Form Controls) The
fourth icon from the left is the Form tool (icon). But first control
the FamilyKey field. Then click the Form tool. (The Form properties
opens.) Click the Data tab. Click the ellipse (...) for "Link master
fields". (The "Linked fields" dialog opens.) Select FamilyKey from the
Roll drop-down list. Select FamilyID from the Families drop-down list.
Click OK. Close the Form Properties dialog. Save the Form. Save the


To unsubscribe e-mail to: users+unsubscribe@global.**lib**

*** <**get-help/mailing-lists/how-to-**>

Posting guidelines + more: http://wiki.**documentfoundati****<**>
Netiquette <http://wiki.****Netiquette<>

List archive: http://listarchives.**libreoff**<>

All messages sent to this list will be publicly archived and cannot be

To unsubscribe e-mail to: users+unsubscribe@global.**<>
Posting guidelines + more: http://wiki.****
Netiquette <>
List archive: http://listarchives.**<>
All messages sent to this list will be publicly archived and cannot be

To unsubscribe e-mail to:
Posting guidelines + more:
List archive:
All messages sent to this list will be publicly archived and cannot be

To unsubscribe e-mail to:
Posting guidelines + more:
List archive:
All messages sent to this list will be publicly archived and cannot be deleted


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.