Page 1 of 2 12 LastLast
Results 1 to 15 of 30
  1. #1
    Solymandias is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2021
    Posts
    14

    How to Link multiple forms to a parent form?

    How can i do that? i've been searching all the internet and i can't find an answer


    I made the forms open depending on a selected value on a combobox but these forms would write data on a new entry instead of the entry that i'm working on my "primary" form

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Is this a main form/subform(s) design? The main form is for a parent record (e.g. PO) and the subform is for the related child records (e.g. PO line items). Existing line items should appear when looking at a PO and you add new line items if it's appropriate.

    Regardless, it seems you have a disconnect between the parent record id and whatever you're doing after that form is open but I can't see your design.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    Solymandias is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2021
    Posts
    14
    i have them disconnected and i want a way to connect them because the form wizard only let me link 1 primary form and 1 subform, i tried tinkering with the code but got nothing and i tried making 1 single table instead of 2 related tables and using filters when openning the child forms and still nothing
    i'm really desperate because i have to complete this proyect for monday

  4. #4
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Suggest you search "ms access link subform main form" to see how to use the properties sheet to link your additional forms or find a video that doesn't use a wizard in the tutorial. That way you'll get pictures or video, which will explain it better than any words I could provide because you're not revealing much so far. I cannot tell if you have 2 or more subforms related to the main, or subform1 related to main but subform2 is related to subform1 - or would subform2 also be related to main?

    Anyway, maybe this one would do it for you as it covers both situations

    https://www.fmsinc.com/microsoftacce...edSubforms.asp
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    Solymandias is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2021
    Posts
    14
    i have 1 form called Main and 6 forms called Reg1,2,3,4,5,6
    Main shows and record data to my table called "Documents"
    And Reg1,2,3,4,5,6 are linked with a table called "Requirements"
    Documents and Requirements are related
    on Main i have a combobox that selects what kind of document is recording, when i click on a button next to that combobox it opens one of the forms "reg1,2,3,4,5 or 6" depending on which option i selected from that combobox
    those forms arent linked with Main, they start on a new record instead of the actual Main record

    i want a way to link those 6 forms to Main
    hope i explained myself well

    oh and that link doesnt help me because i received orders that they want those forms open on a new window and not in the same Main Form window

  6. #6
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,860
    The only way I can think of to do that, is to pass the PK ID in OpenArgs and set a combo to that value and add the rest of the data. Then you can select another value in the combo and add another record if needed.?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  7. #7
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    1,035
    Other way: create a new public custom property on your form for the value you want to pass. Maker sue the property value is updated on the current record. After that you can acces this value from every other form to set/filter the data. Check first if you don't have set the data entry property of the form to true because in this case all existing records are filtered out.

  8. #8
    Solymandias is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2021
    Posts
    14
    could you tell me how can i do that? i don't have much knowledge of access

  9. #9
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Smells like lack of normalization and improper relationships. I'm interpreting post 5 as one "document" and six requirements for it, each requirement represented by a different form. IMHO, more info is required - perhaps pic of relationships and/or more info about the process that the db is supposed to support.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  10. #10
    Solymandias is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2021
    Posts
    14
    Click image for larger version. 

Name:	2021-05-22 (2).png 
Views:	24 
Size:	27.5 KB 
ID:	45276
    Those are the two tables

    the process is that the user record some information in a form like this :
    Click image for larger version. 

Name:	2021-05-22 (5).png 
Views:	24 
Size:	208.5 KB 
ID:	45277
    This is the form that i'm using as my primary form but i'm not doing any change on it still
    These are the data of every document, and i want to put a combobox that let you choose the kind of document you're recording

    These are the forms i'm using as example:
    If you see, there's a combobox with multiple options, if you press the button next to it, it will open a new form
    Click image for larger version. 

Name:	2021-05-22 (5)1.png 
Views:	24 
Size:	13.1 KB 
ID:	45278
    Like this for the first option
    Click image for larger version. 

Name:	2021-05-22 (6).png 
Views:	24 
Size:	9.5 KB 
ID:	45279
    and this for the second option, for example
    Click image for larger version. 

Name:	2021-05-22 (7).png 
Views:	24 
Size:	8.8 KB 
ID:	45280
    the problem is that there are 6 kind of documents and every kind has its own requirements to be considered complete
    that's why i need 6 different forms linked to a single form to just select the kind of document we want to record and show the form with the correspondent requirements of said document and save those requirements within the same record that is open in the primary form
    but those 6 forms just fill a new record

    hope this help :s

  11. #11
    CarlettoFed is online now Competent Performer
    Windows 7 64bit Access 2013 32bit
    Join Date
    Dec 2019
    Posts
    255
    Maybe if you attach a sample file it might be easier to help you.
    However, it is clear that the database structure lacks proper normalization.

  12. #12
    Solymandias is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2021
    Posts
    14
    http://www.mediafire.com/file/s9nlhn...se6.accdb/file

    This is the sample file
    please check it out

  13. #13
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,557
    Hi

    Your table structures are all wrong.

    You need a Primary Key - Autonumber in the Parent table.

    Then in the Related table you need to have a PK Autonumber to identify each Record in the table.
    Also a Foreign Key - Number Datatype which you link to the Primary Key of the Parent table.

    You are using Lookup fields in your Requisitos table. These are a NO NO.
    You can PM me if you need further help.
    Good Reading https://docs.microsoft.com/en-gb/off...on-description

  14. #14
    Solymandias is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2021
    Posts
    14
    the foreing key needs to be autonumber too? or just needs to be a key from the parent table?

    and the lookup fields are neccesary on Requisitos table because i need options for every field, i just dont lookup those options on another table, i just add them on that same field or what can i do instead?
    thanks for the correction

  15. #15
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,557
    Hi
    The Foreign Key is a Number Data Type

    You then need to Enforce Referential Integrity between the tables
    You can PM me if you need further help.
    Good Reading https://docs.microsoft.com/en-gb/off...on-description

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 6
    Last Post: 01-14-2021, 04:54 PM
  2. Replies: 7
    Last Post: 05-12-2018, 05:21 PM
  3. Replies: 0
    Last Post: 07-24-2016, 04:45 AM
  4. Subform with multiple parent forms
    By mwc0914 in forum Forms
    Replies: 8
    Last Post: 03-12-2013, 06:17 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums