469,945 Members | 1,838 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,945 developers. It's quick & easy.

Updation of values in subform when the related data has been deleted from main form

1
Hi
This is surya,

I am struggling with one issue regarding the updation of the value in the sub form ,when the related data has been deleted from the data sheet view of the main form.

I am handling as application built in MS Access,where user updates some information say for example expenses, and the expenses entered will be summed up for every transaction and that total will be shown in a sub form which is integrated in the main form.If the user went wrong in entering any expenses,he just goes to the data sheet view and selecting the entire row and deleting them.After deleting if he goes to the form view the total is not updating .the same total before deletion is still displaying in the form.and if the form is closed and opened the total is getting updated.If the user tries to enter next transaction then both the transactions will be taking simultaneously,ie deleting the old expenses and adding the new expenses.

I created a macro and connected to a button in the data sheet view,and the application will prompt the user to click the button when he deletes any expenses,but i am in search of a solution which automatically updates the total when ever he deletes the expenses.

How can get rid of this problem.
Sep 26 '07 #1
1 1178
puppydogbuddy
1,923 Expert 1GB
Try this (replace the generic names I used with actual names used in your application):

' this code belongs with the subform (not the main form)
Private Sub Form_AfterUpdate
Me.Parent!YourTextbox.Recalc
End Sub
Sep 26 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

18 posts views Thread by Darryl Kerkeslager | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.