In the attached DB I want the data of the control named "difference to be transferred to the yellow control immediately on change. Ihave written a code on the "change " event but it is not working. Please guide me.
In the attached DB I want the data of the control named "difference to be transferred to the yellow control immediately on change. Ihave written a code on the "change " event but it is not working. Please guide me.
I cannot open your database as it is a later version than the one I use.
Are you using the "On Change" Event Procedure of the "difference" field?
And what is the "yellow control"?
Can I ask why you want the "difference" repeated?
OK, the calculation should be in the VBA and the VBA should go in to the "On Change Events" or "After Update Events" of Fields that are involved in the calculation.
I prefer the After Update event.
ie
you want the difference between fields A & B the VBA should be in both A & B's After Update or On Change Event Procedures so that when a value is entered or changed the Yellow Control gets updated.
You should also place the same code in the Form's "On Current" Event so that any values already entered in A & B are calculated and put in the Yellow control.
Historical data can also be updated using an "Update Query" if required.