Results 1 to 10 of 10
  1. #1
    kathi2005 is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Oct 2011
    Posts
    42

    Really stupid Form/Subform question

    Have a form with a sub form.



    How come when I clock add new record on the main form the subform does not do the same, it still has the data from the previous record

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    The subform container on the form (not the subform itself) has master/child link properties that keep the subform in sync with the main form. The wizard would/should have asked about it, but you can set them manually.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    RayMilhon is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Southern California
    Posts
    1,085
    When you add a new record on the main form the record is not updated until you save the record. Since the subform doesn't have a link to the new record it doesn't do anything.

  4. #4
    kathi2005 is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Oct 2011
    Posts
    42
    That is not what is happening. When I add a new record on the main form the subform still has the information of the previous main form. If I update the subform for the new record it updates the record on the previous form as well.

    I know it has to be something I set up incorrectly, I just cannot seem to locate the issue

  5. #5
    CraigDolphin is offline Competent Performer
    Windows XP Access 2000
    Join Date
    Apr 2009
    Location
    Custer, WA, USA
    Posts
    125
    If pbaldy's answer is not the solution I would be shocked. Shocked I tell you!


    Seriously: he's right. Look for the 'Link Child Fields' and 'Link Master Fields' properties of the subform control on the main form. (you have to select the subform control itself, not the subform that is visible within it, and view the data tab of the properties dialog).

    You should have the pk field of the main form's recordsource listed in the link master field property, and the related fk field from the subform's recordsource in the link child field property.

    If these properties are blank, the linkage doesn't exist and, obviously, won't work.
    If the field is missing from your subform (it can be invisible, but must be present), the linkage won't work.

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Are the master/child links set?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    Join Date
    Nov 2011
    Location
    Hamilton, NZ
    Posts
    18
    Please check the file attached.

  8. #8
    kathi2005 is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Oct 2011
    Posts
    42
    Okay that part is fixed. It was the link between the main and the sub form that was the issue.
    Have one last issue with this form and I have no idea how to go about it.
    The form is an order form. Somehow I need to have the footer of the main form give a total of all the individual totals from the sub form. The rest I can fix, but I have to idea how to do this since the subform may only have 1 line or could have an unlimited amount of lines

  9. #9
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    You put a textbox in the footer of the subform that sums the field, and then refer to that textbox on the main form.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  10. #10
    kathi2005 is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Oct 2011
    Posts
    42
    I have 2 forms that I need to do that on. For the first It works wonderfully.

    For the second, which needs to be totaled is a calculated control, it took some time but I have the total working now on the subform, but when I go to put the total on the footer of the main form it does not work

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 7
    Last Post: 09-02-2011, 07:56 AM
  2. Maybe a stupid question
    By rbiggs in forum Programming
    Replies: 1
    Last Post: 08-23-2011, 05:29 PM
  3. Stupid Question
    By ellixer in forum Queries
    Replies: 1
    Last Post: 06-30-2011, 09:33 AM
  4. Stupid Question ?
    By nood in forum Forms
    Replies: 3
    Last Post: 09-29-2010, 07:54 AM
  5. newbie has stupid question
    By Bruzer in forum Access
    Replies: 3
    Last Post: 04-05-2010, 12:03 PM

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