I have a simple database consisting of a table of driving school pupil details and a linked table of the lessons they take including how many hours for each lesson.
I've created a form with a subform. Parent record details on the main form and a table of the lessons on the subform. When I add, change or delete records on the lessons subform, I need to recalculate the total hours from the records on the subform and update the totalhours field on the main form.
I've searched for and found a solution for getting the sum of the hours from the a text box in the footer of the subform to a text field on the main form. It updates itself correctly as I change records in the subform. But I can't get the actual database field on the main form to update when the text field updates. I've tried adding code to the afterupdate, change and dirty events of the text field but the main field still doesn't update itself.
Any help much appreciated.
Cheers
David
I've created a form with a subform. Parent record details on the main form and a table of the lessons on the subform. When I add, change or delete records on the lessons subform, I need to recalculate the total hours from the records on the subform and update the totalhours field on the main form.
I've searched for and found a solution for getting the sum of the hours from the a text box in the footer of the subform to a text field on the main form. It updates itself correctly as I change records in the subform. But I can't get the actual database field on the main form to update when the text field updates. I've tried adding code to the afterupdate, change and dirty events of the text field but the main field still doesn't update itself.
Any help much appreciated.
Cheers
David