Textbox won't recalc

J

Joan

Could someone explain to me how to get a textbox on the main form to recalc
when a record is deleted on a subform? My main form and subform are in edit
mode. When I edit a record on the subform, the textbox on the main form
recalcs to reflect the edited amount. However, when I delete a record on
the subform the textbox on the main form does not reflect the deleted
amount. I have the following code on the subform's AfterUpdate and Delete
events.

Private Sub Form_AfterUpdate()
Me.Recalc
With Me.Parent
.Recalc
!txtDebit = ![InvoiceDetailsSubform]![ExtendedPriceSum]
End With
End Sub

Private Sub Form_Delete(Cancel As Integer)
Me.Recalc
With Me.Parent
.Recalc
!txtDebit = ![InvoiceDetailsSubform]![ExtendedPriceSum]
End With
End Sub


I have tried setting the default value of the textbox on the main form to
the value of a textbox in the subform that totals the charges. These must
be the same amount. I tried to do this by setting the default property of
the textbox on the main form to:
=[Forms]![EditDeleteInvoice]![InvoiceDetailsSubform]![ExtendedPriceSum]
But this is not working either.
The control source of the texbox on the main form is a field in a different
record source than that of the subform.

Would so appreciate any help with this.

Joan
 
J

Joan

Kindly disregard my earlier post. I discovered that my code on the
subform's Delete event should have been on the After Del Confirm event
instead.

Joan
 

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