J
Joan
Hi,
I have a subform on a main form in edit mode. When I attempt to delete a
record on the subform, this action is not immediately reflected in the
totals textbox on the main form. However, when I add another record on the
subform , then the totals textbox on the main form reflects both the
deletion and the additional record. What do I need to add to my code to get
the the totals textbox synchronized with my subform? And why does it not
synchronize just when I delete a record and not when I edit or add a record?
I have tried using .Recalc and .Requery but no luck. Below is the code I
have on the On Delete event of my subform:
Private Sub Form_Delete(Cancel As Integer)
Me.Recalc
With Me.Parent
.Recalc
.Requery
!txtDebit = ![InvoiceDetailsSubform]![ExtendedPriceSum]
End With
End Sub
Private Sub Form_AfterUpdate()
Me.Recalc
With Me.Parent
.Recalc
!txtDebit = ![InvoiceDetailsSubform]![ExtendedPriceSum]
End With
End Sub
Joan
I have a subform on a main form in edit mode. When I attempt to delete a
record on the subform, this action is not immediately reflected in the
totals textbox on the main form. However, when I add another record on the
subform , then the totals textbox on the main form reflects both the
deletion and the additional record. What do I need to add to my code to get
the the totals textbox synchronized with my subform? And why does it not
synchronize just when I delete a record and not when I edit or add a record?
I have tried using .Recalc and .Requery but no luck. Below is the code I
have on the On Delete event of my subform:
Private Sub Form_Delete(Cancel As Integer)
Me.Recalc
With Me.Parent
.Recalc
.Requery
!txtDebit = ![InvoiceDetailsSubform]![ExtendedPriceSum]
End With
End Sub
Private Sub Form_AfterUpdate()
Me.Recalc
With Me.Parent
.Recalc
!txtDebit = ![InvoiceDetailsSubform]![ExtendedPriceSum]
End With
End Sub
Joan