Results 1 to 6 of 6
  1. #1
    Star Lounger
    Join Date
    May 2002
    Location
    Patagonia Region Chile
    Posts
    78
    Thanks
    0
    Thanked 0 Times in 0 Posts

    dsum on subform (access 2k)

    Hello.

    I have a sub form linked to the main form

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: dsum on subform (access 2k)

    You can create a totals query that groups on the fields that link the subform to the main form and on the "team" field, and counts on any non-null field.
    Create a continuous or datasheet form based on this query and place it as a second subform on the main form, linked by the appropriate fields.

  3. #3
    Star Lounger
    Join Date
    May 2002
    Location
    Patagonia Region Chile
    Posts
    78
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: dsum on subform (access 2k)

    Thanks Hans.

    I have that working now as you instructed. However When I change the number of ponts on my first subform. The new second form does not update unless I put the focus on the main form and manually refresh. I have tried my hand with all manner of events like "afterupdate" to no avail. Any thoughts. Thanks

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: dsum on subform (access 2k)

    You can put code in the After Update event of the relevant control(s) of the first subform:
    <code>
    Private Sub ControlName_AfterUpdate()
    Me.Parent!SecondSubform.Requery
    End Sub
    </code>
    Parent refers to the main form, and SecondSubform must be the name of the second subform as a control on the main form. This is not necessarily the same as the name of the subform in the database window.

  5. #5
    Star Lounger
    Join Date
    May 2002
    Location
    Patagonia Region Chile
    Posts
    78
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: dsum on subform (access 2k)

    Thanks Hans.

    I did as you say. I got inconsistent results. Not sure why. Sometimes it updated others is did not. I added to yours and think I have consistent updating now. Will keep testing

    I used this in case you are interested....

    Private Sub cntdpuntos_AfterUpdate()
    Me.refresh
    Me.Parent!frmAsigsubPuntoSUM.Requery
    End Sub

    Thanks again very much

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: dsum on subform (access 2k)

    Glad you were able to solve it!

Posting Permissions

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