• Requery parent (Access 2002)

    Author
    Topic
    #364590

    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 help

    Viewing 0 reply threads
    Author
    Replies
    • #560160

      Try a Parent.Repaint

      • #560178

        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

        • #560218

          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.

          • #560221

            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

            • #560232

              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.

            • #560545

              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

    Viewing 0 reply threads
    Reply To: Requery parent (Access 2002)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: