Results 1 to 7 of 7
  1. #1
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Requery parent (Access 2002)

    I have a parent form "frmPerson" and subform "frmClasses". On the Parent form there is a textbox "txtTotalPer". On the frmClasses subform the user will type in a number of contact hours received. Once they leave that new record I want the txtTotalPer to update reflecting the new total number of contact hours per license period.

    I tried this without results.

    Private Sub Form_AfterUpdate()
    Parent!txtTotalPer.Requery
    End Sub

    I would appreciate your help. Thank you. Fay <img src=/S/help.gif border=0 alt=help width=23 height=15>

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Requery parent (Access 2002)

    Try a Parent.Repaint
    Charlotte

  3. #3
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Requery parent (Access 2002)

    I tried

    Private Sub Form_AfterUpdate()
    Parent.Repaint
    End Sub

    I also tried Parent!txtTotalPer.Repaint

    It does not change the text box.

    Thank you. Fay

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Requery parent (Access 2002)

    I meant *after* you requeried the control on the parent form. I should have asked first, though, what the controlsource is for the control on the parent form and what else is going on at this point in your form and subform.
    Charlotte

  5. #5
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Requery parent (Access 2002)

    I put the repaint line in the requery code and it didn't work.

    The source for the txtTotalPer textbox and the parent form is a query "qryPerson" The frmClasses is tied to a query qryClasses. I am not sure what you mean about what else is going on. To this point there is no code except to maximize the parent form on opening. The arrangement is a simple parent and unglamorous child form. Most data will be entered on the subform. Thanks for working with me. Fay

  6. #6
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Requery parent (Access 2002)

    I solved the problem. I put a textbox with the control source of =Sum[] in the footer of the subform then made the control source on the textbox on the parent form to the textbox on the subform. It worked like a champ doing exactly what I needed it to do. Thanks. Fay

  7. #7
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Requery parent (Access 2002)

    If the txtTotalPer control is bound to a field in a query instead of being calculated from the subform, then what is the connection? I assumed txtTotalPer had a controlsource that calculated the sum of a particular field in the subform's recordset. If that isn't the case then there's no point in requerying that control.
    Charlotte

Posting Permissions

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