Fill fields with *two* mother tables ?

Hi all,

I need your help to solde something’s probably easy to do, but I can’t find the solution (and I looked for on LOT of forums ^^) : as you’ll see in my sample, a table is linked to 2 difference tables, with no links between the 2 “parents” (except the daughter, so :)).

I would like to choose the value (existing record) for the first table (mother 1), choose the value (existing record) for the second (mother 2) and then populate values for the fields of the child.

It’s ok, using form and sub-forms, for one parent, but I don’t know how to do for the second one.

The sample here is showing you my problem (you’ll see a N-N link for one side, but it’s not a problem :))

thank you for your help !

SinBDDExemple01.odb

LibreOffice Version: 6.2.3.2, MacOS.

Please note using link when cross posting. Also posted here → [Base] Lier un sous-formulaire à deux formulaires parents ? (ou faire autrement...).

This saves duplicate efforts!

It was not a waste and duplicate effort for me to write two messages with different languages : as you probably noticed, one of the message is in French and the other in English. It seems that all people doesn’t have your foreign language skill and are reading mother language questions :).
I also noticed that nobody answered both sides : I’m happy to avoid people duplicate efforts.
Thank you.

@Sinisan It was some waste since you had someone else work on a problem already answered and this resulted in nearly the same answer. Duplicate effort! You need to consider others.

I only use English - all else is Google! Amazing what can be done if one wants to. Have presented answers in other Ask language sites. There are many others who do so also.

Both sites did present a valid answer but you did not like what was presented. Please see edited answer (one which I had already given you - macro) for a sample of what you wanted.

Hello,

There is doubt as the validity of this entire process. As to filling a form from two other forms this is usually done with list boxes. There is no linking in Base from two main forms to a sub form; appears this is truly the many-to-many record.

The real question here comes with the process already in place using the main → sub form → sub sub form. The sub form is a query. This data is volatile. What is entered today is not what it may be tomorrow thus making the data in TResponses invalid. Because of the query, there is no chain to update.

It appears this should be simplified.

Edit 2019-05-27:

Have attached a sample performing what you requested by using macros. Based upon a comment of yours, it appears you do not know how to write macro code. This is going to make using any of this harder as this is not the place to teach one how. This is a difficult process for one beginning with code.

Also, as stated earlier:

There is doubt as the validity of this entire process.

When you inspect the displays you will see that there is no direct relation in the Responses table back through the Groups table. I would avoid this process entirely but I’ve stated that already and this is what you asked for.

Sample ----- FillSubFormMacro.odb

Thank you for your answer. I was not clear, so let’s forget the first sample and try something else, simplified :

  • a table “Country”
  • a table “decade”.
  • a table “person”, with a link to Country and a link to Decade.

What I want to do is to add some people in my base, BUT I would like to first select the Country on which I’ll work for the moment (I don’t want to add Countries here, just select existing one). I also want to select the Decade (I don’t want to add Decades here, just select existing one).
Now that’s the both informations have been selected (on which country and with decade I’ll work during this session), I want to be able to add or modify people. I really don’t want to select country and decade each time I add or modify people.

As you can see, I don’t want to select Country and Decade for EACH people individually ; so, I don’t want to use list boxes for each person record. You also see that my two “parents” table have no link between them. Thank you :slight_smile:

Only possible method I can visualize for that is to use macros. This would need to be written specifically for your process. Again, there is nothing in Base to link two main forms to a single sub form which is what it appears you want.

Thank you for your answer. Again, I don’t want to link two main forms to a single sub form, I want to populate a table without having to choose the same two things (value of fields) for each 30 or 40 records (which is the real job), as I said in the title. I already had a look on macro side, but I have no idea of the process. I’ll keep looking for. Thank you

Actually that is exactly what you are trying to accomplish - link two main forms to a sub form. This linking (in form property) is how the data is automatically placed within those fields linked.

You know what I know or not, you know what I want or not : thank you for all your effort and your waste of time.