Popup form update to parent form

P

Pendragon

Access03/WinXP

I have a pop-up form for entering payments; the popup form itself
(frmInvoicing) has invoice data while a subform (frmPayments) allows the user
to input multiple payment items. The field on frmPayments is PaymentAmount.
In the footer of frmPayments I have txtTotalPayments which is set to
=Sum([PaymentAmount]).

After a payment entry is made, I am using a refresh command to update the
subtotal (txtTotalPayments). I am trying to pass this subtotal back to the
parent form of the popup form - frmSales - into a field txtCorpPmts.

What is happening is that after a payment entry is made, the subtotal is
updating to the appropriate total, but the parent form's txtCorpPmts is
updating to the previous total.

Simple example:

Default value of txtTotalPayments is set to 0. After entering the first
payment of $100, txtTotalPayments updates to $100, but txtCorpPmts on the
primary form updates to $0. When I delete the payment record (and refresh
and requery the popup form in the OnDelete property), txtTotalPayments
updates to $0 but txtCorpPmts updates to $100.

Here is the code for the AfterUpdate button of txtPaymentAmount on
frmPayments (I use the same code in the OnDelete):

Me.Refresh
Forms!frmInvoicing.frmPayments.Requery
Forms!frmSales.txtCorpPmts = Me.txtTotalPayments

Any guidance is appreciated!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top