techkenny1
Technical User
Hi all,
I have been trying to find out how to update the mainform [blue]Totals[/blue] field when you add or change data in a text field in a subform.
The subform (continous) has a subtotals column and there are 3 textfields, the datatype being [blue]Number[/blue] and the fieldsize being [blue]double[/blue]. The subtotals is summed by using code on the [blue]Lost Focus[/blue] event on these fields.
The [blue]Invoice Total[/blue] is on the mainform. The mainform has a refresh command button and this works ok to refresh the data on the mainform.
I have searched the forums to see if the total on the mainform can be automatically updated when the data is changed or added on the subform.
I did find this code;
[blue]Sub myTextbox AfterUpdate()
Form!MasterForm.setfocus
Docmd.Runcommand.accmdrefresh
Form!MasterForm!SubForm.SetFocus
End Sub [/blue]
I changed the names of the main and sub forms, but was not able to get this to refresh the data on the mainform.
Many thanks
kp
__________________
I have been trying to find out how to update the mainform [blue]Totals[/blue] field when you add or change data in a text field in a subform.
The subform (continous) has a subtotals column and there are 3 textfields, the datatype being [blue]Number[/blue] and the fieldsize being [blue]double[/blue]. The subtotals is summed by using code on the [blue]Lost Focus[/blue] event on these fields.
The [blue]Invoice Total[/blue] is on the mainform. The mainform has a refresh command button and this works ok to refresh the data on the mainform.
I have searched the forums to see if the total on the mainform can be automatically updated when the data is changed or added on the subform.
I did find this code;
[blue]Sub myTextbox AfterUpdate()
Form!MasterForm.setfocus
Docmd.Runcommand.accmdrefresh
Form!MasterForm!SubForm.SetFocus
End Sub [/blue]
I changed the names of the main and sub forms, but was not able to get this to refresh the data on the mainform.
Many thanks
kp
__________________