I'm looking at a form that has a sub form and in the sub form there is a total of one of the fields (ie =sum(field1)) Let's call this sumcontrol1
If any of one of these field1 fields is updated and the cursor put on to any other row then sum(field1) gets updated automatically.
Now this form has a button on the main form. When this is clicked an unbound control (let's call it mainformsum) on the main form is set to sumcontrol1. This works to a fashion.
If a field is changed and the cursor is not moved then when the button is clicked it picks up the old total in sumcontrol1 so mainformsum = old sumcontrol1. After the click sumcontrol1 is then updated. To get mainformsum updated to the correct amount the button has to be clicked again. Can I get around this?
so
Field1
10
12
18
20
Sumcontrol1 = 60
If 10 is changed to 20 and the cursor put onto the following field1 (ie the 12) then sumcontrol becomes 70. If the button is then clicked mainformsum becomes 70 as well.
Now if 10 is changed to 20 and the cursor is left on that field then prior to button being clicked sumcontrol1 = 60. When button is clicked mainformsum becomes 60 and then sumcontrol1 becomes 70.
In the event for the click can I force the update of sumcontrol1?
Hope this all makes sense
If any of one of these field1 fields is updated and the cursor put on to any other row then sum(field1) gets updated automatically.
Now this form has a button on the main form. When this is clicked an unbound control (let's call it mainformsum) on the main form is set to sumcontrol1. This works to a fashion.
If a field is changed and the cursor is not moved then when the button is clicked it picks up the old total in sumcontrol1 so mainformsum = old sumcontrol1. After the click sumcontrol1 is then updated. To get mainformsum updated to the correct amount the button has to be clicked again. Can I get around this?
so
Field1
10
12
18
20
Sumcontrol1 = 60
If 10 is changed to 20 and the cursor put onto the following field1 (ie the 12) then sumcontrol becomes 70. If the button is then clicked mainformsum becomes 70 as well.
Now if 10 is changed to 20 and the cursor is left on that field then prior to button being clicked sumcontrol1 = 60. When button is clicked mainformsum becomes 60 and then sumcontrol1 becomes 70.
In the event for the click can I force the update of sumcontrol1?
Hope this all makes sense