Results 1 to 8 of 8
  1. #1
    Join Date
    Dec 2004
    Posts
    7

    Angry Unanswered: One Form from different tabbles

    I have three tables:

    Table1, table2 and Table3

    Table1 and table2 are related to table3 but arent related to each other.

    I need to make a form that should have fields from table1 and table2, and table3 will be a sub-form and should only appear the values related to table1 and table2.

    How can I do this?

    Thanks

  2. #2
    Join Date
    Nov 2002
    Location
    Norway
    Posts
    239

    Thumbs up Make a query of ....

    1 - Create a query of table1 and table2.
    2 - Create a your "mainform" based upon the new query
    3 - Create a "subform" based upon table 3
    4 - Insert your "subform" into your "mainform" and link these two forms with a common field
    (link masterfield / link child field)

    Viola

  3. #3
    Join Date
    Dec 2004
    Posts
    7
    Quote Originally Posted by vestigo
    1 - Create a query of table1 and table2.
    2 - Create a your "mainform" based upon the new query
    3 - Create a "subform" based upon table 3
    4 - Insert your "subform" into your "mainform" and link these two forms with a common field
    (link masterfield / link child field)

    Viola

    Hi

    I've tried this.... and I think it wil work... but when I run the query with both fields from the two differente non related tables it duplicates the records that they have.....

    How can I fix this??

  4. #4
    Join Date
    Nov 2002
    Location
    Norway
    Posts
    239

    Use group by

    "Σ" in the menu bar

  5. #5
    Join Date
    Nov 2003
    Location
    LONDON
    Posts
    238
    Quote Originally Posted by hhenriques
    I have three tables:

    Table1, table2 and Table3

    Table1 and table2 are related to table3 but arent related to each other.

    I need to make a form that should have fields from table1 and table2, and table3 will be a sub-form and should only appear the values related to table1 and table2.

    How can I do this?

    Thanks
    What is the type of relationship between the tables? ie is it a one-many relationship between table 1 and table 3, and one-many between table 2 and table 3 or does table 3 have a one-many relationship with tables 1 and 2.

    The sub-form should always be the table that is on the many side of the relationship. Use the LinkChildFields and LinkMasterFields to provide the link between the main form and the sub form.

    Justin

  6. #6
    Join Date
    Dec 2004
    Posts
    7
    Quote Originally Posted by justin_tighe
    What is the type of relationship between the tables? ie is it a one-many relationship between table 1 and table 3, and one-many between table 2 and table 3 or does table 3 have a one-many relationship with tables 1 and 2.

    The sub-form should always be the table that is on the many side of the relationship. Use the LinkChildFields and LinkMasterFields to provide the link between the main form and the sub form.

    Justin
    Hi

    It is one to many between table 1 and 3 ; one to many in table 2 and 3.

    But don't forget that table 1 and table 2 aren't related with each other. I've tried the group by but it gets the same. Can you help me??

    Thanks!!!!

  7. #7
    Join Date
    Nov 2003
    Location
    LONDON
    Posts
    238
    Quote Originally Posted by hhenriques
    Hi

    It is one to many between table 1 and 3 ; one to many in table 2 and 3.

    But don't forget that table 1 and table 2 aren't related with each other. I've tried the group by but it gets the same. Can you help me??

    Thanks!!!!
    Tables 1 and 2 may not be directly related but they are indirectly related through table 3. The subform should consist of table 3.

    Tables 1,2,3 should be combined in a query, selecting the fields you require and this query will become the main form. Remember to have the foreign fields (joining fields) between the 3 tables in your query so that you can hook the main form to the sub form.

    You probably will not be able to edit the main form - use a separate editing form to do this, but you should be able to edit the sub-form.

  8. #8
    Join Date
    Dec 2004
    Posts
    7

    Angry

    Quote Originally Posted by justin_tighe
    Tables 1 and 2 may not be directly related but they are indirectly related through table 3. The subform should consist of table 3.

    Tables 1,2,3 should be combined in a query, selecting the fields you require and this query will become the main form. Remember to have the foreign fields (joining fields) between the 3 tables in your query so that you can hook the main form to the sub form.

    You probably will not be able to edit the main form - use a separate editing form to do this, but you should be able to edit the sub-form.
    I've tried this... but the result is the same.... it will not only do not show all info in table1.... but keeps repeating the info several times....

    I've created a query with table1 table2 and table3 with the fieds that are related with table3...... but the result is the same...

    when I put group by in all the fields the result is the same..... what can I do?

    It works weel in the main form and sub-form.... the only thing is that it isn't there all the info necessary and it is repetead severel times.

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •