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
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