none
Update subform information from main form data RRS feed

  • Question

  • I'm very new in Access development.

    I've the following database where the subform shows the query information based on the criteria in dist_date.

    The subform only shows information if I click "Refresh All" button on top. It doesn't update if I change the data from the bottom record navigation button.

    What I want to do is,

    • I want to use the Next and Previous button to navigate the data in main form and based on the text in dist_date, the subform would update. so that I would not have to click "Refresh" button.

    Here is the database you can download to help me. I swear this is a harmless file!


    AdNaN

    Wednesday, October 9, 2019 5:54 PM

All replies

  • I appreciate you are a newbie, but please use precise language. You cannot "change the data from the bottom record navigation button": the navigation buttons are to change the current record, not to change data.

    If I understand you correctly you want to enter a date in DistDate, and have the subform show data for that date. In that textbox' AfterUpdate event write the one-liner:
    Me.mySubformControlName.Requery

    To link the subform data to DistDate, so you can navigate to another parent record and have it automatically refresh to show the data for that date, set the subform control's LinkMasterFields and LinkChildFields to the common field name, presumably dist_date.



    -Tom. Microsoft Access MVP

    Thursday, October 10, 2019 1:55 PM
  • I downloaded your file. A few comments:

    1. the common field name for LinkMaster/LinkChildFields is dis_date.

    2. The query needs to be modified. Take out the criterion, and check the box to show the dis_date column.

    3. It is very unusual to show the SAME table data in both the parent form and the child form. I could see how that could be confusing to users, or cause problems with editing (related to record locking).

    4. Use Database Tools > Relationships to setup relations between your tables, and check the box to enforce them. You will then find out you have table design problems, for example tbl_Data.IP_ID should not be text, but long integer. camp_name should be camp_id long integer. tbl_Camp.camp_ID should be the primary key.


    -Tom. Microsoft Access MVP

    Thursday, October 10, 2019 2:06 PM
  • I downloaded your file. A few comments:

    1. the common field name for LinkMaster/LinkChildFields is dis_date.

    2. The query needs to be modified. Take out the criterion, and check the box to show the dis_date column.

    3. It is very unusual to show the SAME table data in both the parent form and the child form. I could see how that could be confusing to users, or cause problems with editing (related to record locking).

    4. Use Database Tools > Relationships to setup relations between your tables, and check the box to enforce them. You will then find out you have table design problems, for example tbl_Data.IP_ID should not be text, but long integer. camp_name should be camp_id long integer. tbl_Camp.camp_ID should be the primary key.


    -Tom. Microsoft Access MVP

    Thank you very much for your kind suggestions and trusting my file. I shall try to follow your suggestion first and if I fail, I would seek your suggestion again.


    AdNaN

    Thursday, October 10, 2019 2:10 PM